… | |
… | |
394 | if (ip > 2 * item_power && ip > (item_power + 3)) |
394 | if (ip > 2 * item_power && ip > (item_power + 3)) |
395 | LOG (llevDebug, "Object %s seems to have too low item power? %d > %d\n", debug_desc (), ip, item_power); |
395 | LOG (llevDebug, "Object %s seems to have too low item power? %d > %d\n", debug_desc (), ip, item_power); |
396 | #endif |
396 | #endif |
397 | } |
397 | } |
398 | |
398 | |
399 | /* old style spellcasting object (pretty common) - need to load in the appropiate object */ |
399 | /* old style spellcasting object (pretty common) - need to load in the appropriate object */ |
400 | /* (schmorp) old really doesn't mean old, imho, just a more compact way to store such objects */ |
400 | /* (schmorp) old really doesn't mean old, imho, just a more compact way to store such objects */ |
401 | if ((type == ROD |
401 | if ((type == ROD |
402 | || type == WAND |
402 | || type == WAND |
403 | || type == SCROLL |
403 | || type == SCROLL |
404 | || type == HORN |
404 | || type == HORN |
… | |
… | |
1340 | |
1340 | |
1341 | CMP_OUT (tag); |
1341 | CMP_OUT (tag); |
1342 | CMP_OUT (custom_name); |
1342 | CMP_OUT (custom_name); |
1343 | |
1343 | |
1344 | if (object *owner = op->owner) |
1344 | if (object *owner = op->owner) |
1345 | f.put (KW(owner), static_cast<const char *>(owner->ref ())); |
1345 | if (const char *ref = owner->ref ()) |
|
|
1346 | f.put (KW(owner), ref); |
1346 | |
1347 | |
1347 | // memory, attacked_by, chosen_skill, spellitem, spell, current_weapon, arch not saved |
1348 | // memory, attacked_by, chosen_skill, spellitem, spell, current_weapon, arch not saved |
1348 | |
1349 | |
1349 | CMP_OUT (other_arch); |
1350 | CMP_OUT (other_arch); |
1350 | |
1351 | |
… | |
… | |
1450 | CMP_OUT (move_slow); |
1451 | CMP_OUT (move_slow); |
1451 | CMP_OUT (move_slow_penalty); |
1452 | CMP_OUT (move_slow_penalty); |
1452 | |
1453 | |
1453 | object::flags_t diff = (op->flag ^ arch->flag) & flagmask; |
1454 | object::flags_t diff = (op->flag ^ arch->flag) & flagmask; |
1454 | |
1455 | |
|
|
1456 | #if stdcpp // we need gcc, sorry |
1455 | if (diff [FLAG_OBJ_ORIGINAL]) |
1457 | if (diff [FLAG_OBJ_ORIGINAL]) |
1456 | f.put (flag_names [FLAG_OBJ_ORIGINAL], op->flag [FLAG_OBJ_ORIGINAL] ? CS(1) : CS(0)); |
1458 | f.put (flag_names [FLAG_OBJ_ORIGINAL], op->flag [FLAG_OBJ_ORIGINAL] ? CS(1) : CS(0)); |
1457 | |
1459 | |
1458 | diff.reset (FLAG_OBJ_ORIGINAL); |
1460 | diff.reset (FLAG_OBJ_ORIGINAL); |
1459 | |
1461 | |
1460 | // quickly test whether any other flags differ |
1462 | // quickly test whether any other flags differ |
1461 | if (expect_true (diff.any ())) |
1463 | if (expect_true (diff.any ())) |
1462 | for (int i = 0; i < NUM_FLAGS; i++) |
1464 | for (int i = 0; i < NUM_FLAGS; i++) |
1463 | if (expect_false (diff [i])) |
1465 | if (expect_false (diff [i])) |
1464 | f.put (flag_names [i], op->flag [i] ? CS(1) : CS(0)); |
1466 | f.put (flag_names [i], op->flag [i] ? CS(1) : CS(0)); |
|
|
1467 | #else |
|
|
1468 | // use sgi extensions |
|
|
1469 | for (int i = diff._Find_first (); i < diff.size (); i = diff._Find_next (i)) |
|
|
1470 | f.put (flag_names [i], op->flag [i] ? CS(1) : CS(0)); |
|
|
1471 | #endif |
1465 | |
1472 | |
1466 | // save body locations. gcc's memcmp does an abysmal job when used |
1473 | // save body locations. gcc's memcmp does an abysmal job when used |
1467 | for (int i = 0; i < NUM_BODY_LOCATIONS; i++) |
1474 | for (int i = 0; i < NUM_BODY_LOCATIONS; i++) |
1468 | if (expect_false (op->slot[i].info != arch->slot[i].info)) |
1475 | if (expect_false (op->slot[i].info != arch->slot[i].info)) |
1469 | f.put (body_locations[i].save_name, op->slot[i].info); |
1476 | f.put (body_locations[i].save_name, op->slot[i].info); |