--- deliantra/server/common/loader.C 2009/11/11 18:06:46 1.147 +++ deliantra/server/common/loader.C 2009/11/11 23:27:56 1.148 @@ -1289,8 +1289,8 @@ f.alloc (ptr - cur); } -#define CMP_OUT(v) if (expect_false (op->v != arch->v)) f.put (KW_ ## v, op->v) -#define CMP_OUT2(k,v) if (expect_false (op->v != arch->v)) f.put (KW_ ## k, op->v) +#define CMP_OUT(v) if (expect_false (op->v != arch->v)) f.put (KW (v), op->v) +#define CMP_OUT2(k,v) if (expect_false (op->v != arch->v)) f.put (KW (k), op->v) CMP_OUT (x); CMP_OUT (y); @@ -1331,25 +1331,25 @@ CMP_OUT (custom_name); if (object *owner = op->owner) - f.put (KW_owner, static_cast(owner->ref ())); + f.put (KW(owner), static_cast(owner->ref ())); // memory, attacked_by, chosen_skill, spellitem, spell, current_weapon, arch not saved CMP_OUT (other_arch); - if (op->msg != arch->msg ) f.put (KW_msg , KW_endmsg , op->msg ); - if (op->lore != arch->lore) f.put (KW_lore, KW_endlore, op->lore); + if (op->msg != arch->msg ) f.put (KW(msg) , KW(endmsg) , op->msg ); + if (op->lore != arch->lore) f.put (KW(lore), KW(endlore), op->lore); - if (op->face != arch->face ) f.put (KW_face , op->face ? &faces [op->face ] : 0); - if (op->sound != arch->sound ) f.put (KW_sound , op->sound ? &faces [op->sound ] : 0); - if (op->sound_destroy != arch->sound_destroy) f.put (KW_sound_destroy, op->sound_destroy ? &faces [op->sound_destroy] : 0); + if (op->face != arch->face ) f.put (KW(face) , op->face ? &faces [op->face ] : 0); + if (op->sound != arch->sound ) f.put (KW(sound) , op->sound ? &faces [op->sound ] : 0); + if (op->sound_destroy != arch->sound_destroy) f.put (KW(sound_destroy), op->sound_destroy ? &faces [op->sound_destroy] : 0); if (op->animation_id != arch->animation_id) if (op->has_anim ()) - f.put (KW_animation, op->anim ().name); + f.put (KW(animation), op->anim ().name); else { - f.put (KW_animation, (const char *)0); + f.put (KW(animation)); op->flag [FLAG_ANIMATE] = false; // TODO: why force to false here? } @@ -1395,7 +1395,7 @@ CMP_OUT2 (material, materials);//TODO: nuke if (op->material != arch->material) - f.put (KW_materialname, op->material->name); + f.put (KW(materialname), op->material->name); CMP_OUT (value); CMP_OUT (carrying); @@ -1411,7 +1411,7 @@ if (op->flag [FLAG_IS_LINKED]) if (auto (ol, op->find_link ())) - f.put (KW_connected, ol->id); + f.put (KW(connected), ol->id); CMP_OUT (randomitems); CMP_OUT2 (container, weight_limit); @@ -1441,7 +1441,7 @@ object::flags_t diff = (op->flag ^ arch->flag) & flagmask; if (diff [FLAG_OBJ_ORIGINAL]) - f.put (flag_names [FLAG_OBJ_ORIGINAL], op->flag [FLAG_OBJ_ORIGINAL] ? "1" : "0"); + f.put (flag_names [FLAG_OBJ_ORIGINAL], op->flag [FLAG_OBJ_ORIGINAL] ? CS(1) : CS(0)); diff.reset (FLAG_OBJ_ORIGINAL); @@ -1449,7 +1449,7 @@ if (expect_true (diff.any ())) for (int i = 0; i < NUM_FLAGS; i++) if (expect_false (diff [i])) - f.put (flag_names [i], op->flag [i] ? "1" : "0"); + f.put (flag_names [i], op->flag [i] ? CS(1) : CS(0)); // save body locations. gcc's memcmp does an abysmal job when used for (int i = 0; i < NUM_BODY_LOCATIONS; i++) @@ -1465,14 +1465,14 @@ bool object::write (object_freezer &f) { - if (is_arch ()) + if (expect_false (is_arch ())) { - f.put (KW_object, arch->archname); + f.put (KW(object), arch->archname); write_diff (f, this, archetype::empty); } else { - f.put (KW_arch, arch->archname); + f.put (KW(arch), arch->archname); write_diff (f, this, arch); } @@ -1480,7 +1480,7 @@ tmp->write (f); f.put (this); - f.put (KW_end); + f.put (KW(end)); return true; }