… | |
… | |
909 | || map->in_memory != MAP_ACTIVE |
909 | || map->in_memory != MAP_ACTIVE |
910 | || map->no_drop |
910 | || map->no_drop |
911 | || ms ().move_block == MOVE_ALL) |
911 | || ms ().move_block == MOVE_ALL) |
912 | { |
912 | { |
913 | while (inv) |
913 | while (inv) |
914 | inv->destroy (true); |
914 | inv->destroy (); |
915 | } |
915 | } |
916 | else |
916 | else |
917 | { /* Put objects in inventory onto this space */ |
917 | { /* Put objects in inventory onto this space */ |
918 | while (inv) |
918 | while (inv) |
919 | { |
919 | { |
… | |
… | |
923 | || op->flag [FLAG_NO_DROP] |
923 | || op->flag [FLAG_NO_DROP] |
924 | || op->type == RUNE |
924 | || op->type == RUNE |
925 | || op->type == TRAP |
925 | || op->type == TRAP |
926 | || op->flag [FLAG_IS_A_TEMPLATE] |
926 | || op->flag [FLAG_IS_A_TEMPLATE] |
927 | || op->flag [FLAG_DESTROY_ON_DEATH]) |
927 | || op->flag [FLAG_DESTROY_ON_DEATH]) |
928 | op->destroy (true); |
928 | op->destroy (); |
929 | else |
929 | else |
930 | map->insert (op, x, y); |
930 | map->insert (op, x, y); |
931 | } |
931 | } |
932 | } |
932 | } |
933 | } |
933 | } |
… | |
… | |
983 | x = 1; |
983 | x = 1; |
984 | y = 1; |
984 | y = 1; |
985 | |
985 | |
986 | if (more) |
986 | if (more) |
987 | { |
987 | { |
988 | more->destroy (true); |
988 | more->destroy (); |
989 | more = 0; |
989 | more = 0; |
990 | } |
990 | } |
991 | |
991 | |
992 | head = 0; |
992 | head = 0; |
993 | |
993 | |
… | |
… | |
1191 | esrv_update_item (UPD_NROF, pl, top); |
1191 | esrv_update_item (UPD_NROF, pl, top); |
1192 | |
1192 | |
1193 | op->weight = 0; // cancel the addition above |
1193 | op->weight = 0; // cancel the addition above |
1194 | op->carrying = 0; // must be 0 already |
1194 | op->carrying = 0; // must be 0 already |
1195 | |
1195 | |
1196 | op->destroy (true); |
1196 | op->destroy (); |
1197 | |
1197 | |
1198 | return top; |
1198 | return top; |
1199 | } |
1199 | } |
1200 | |
1200 | |
1201 | return 0; |
1201 | return 0; |
… | |
… | |
1286 | * of areas of callers (eg, anything that uses find_free_spot would now |
1286 | * of areas of callers (eg, anything that uses find_free_spot would now |
1287 | * need extra work |
1287 | * need extra work |
1288 | */ |
1288 | */ |
1289 | if (!xy_normalise (m, op->x, op->y)) |
1289 | if (!xy_normalise (m, op->x, op->y)) |
1290 | { |
1290 | { |
1291 | op->head_ ()->destroy (true);// remove head_ once all tail object destroyers found |
1291 | op->head_ ()->destroy ();// remove head_ once all tail object destroyers found |
1292 | return 0; |
1292 | return 0; |
1293 | } |
1293 | } |
1294 | |
1294 | |
1295 | if (object *more = op->more) |
1295 | if (object *more = op->more) |
1296 | if (!insert_ob_in_map (more, m, originator, flag)) |
1296 | if (!insert_ob_in_map (more, m, originator, flag)) |
… | |
… | |
1309 | { |
1309 | { |
1310 | // TODO: we actually want to update tmp, not op, |
1310 | // TODO: we actually want to update tmp, not op, |
1311 | // but some caller surely breaks when we return tmp |
1311 | // but some caller surely breaks when we return tmp |
1312 | // from here :/ |
1312 | // from here :/ |
1313 | op->nrof += tmp->nrof; |
1313 | op->nrof += tmp->nrof; |
1314 | tmp->destroy (true); |
1314 | tmp->destroy (); |
1315 | } |
1315 | } |
1316 | |
1316 | |
1317 | CLEAR_FLAG (op, FLAG_APPLIED); /* hack for fixing F_APPLIED in items of dead people */ |
1317 | CLEAR_FLAG (op, FLAG_APPLIED); /* hack for fixing F_APPLIED in items of dead people */ |
1318 | CLEAR_FLAG (op, FLAG_INV_LOCKED); |
1318 | CLEAR_FLAG (op, FLAG_INV_LOCKED); |
1319 | |
1319 | |
… | |
… | |
1494 | { |
1494 | { |
1495 | /* first search for itself and remove any old instances */ |
1495 | /* first search for itself and remove any old instances */ |
1496 | |
1496 | |
1497 | for (object *tmp = op->ms ().bot; tmp; tmp = tmp->above) |
1497 | for (object *tmp = op->ms ().bot; tmp; tmp = tmp->above) |
1498 | if (!strcmp (tmp->arch->archname, arch_string)) /* same archetype */ |
1498 | if (!strcmp (tmp->arch->archname, arch_string)) /* same archetype */ |
1499 | tmp->destroy (true); |
1499 | tmp->destroy (); |
1500 | |
1500 | |
1501 | object *tmp = arch_to_object (archetype::find (arch_string)); |
1501 | object *tmp = arch_to_object (archetype::find (arch_string)); |
1502 | |
1502 | |
1503 | tmp->x = op->x; |
1503 | tmp->x = op->x; |
1504 | tmp->y = op->y; |
1504 | tmp->y = op->y; |
… | |
… | |
1627 | if (object *pl = tmp->visible_to ()) |
1627 | if (object *pl = tmp->visible_to ()) |
1628 | esrv_update_item (UPD_NROF, pl, tmp); |
1628 | esrv_update_item (UPD_NROF, pl, tmp); |
1629 | |
1629 | |
1630 | adjust_weight (this, op->total_weight ()); |
1630 | adjust_weight (this, op->total_weight ()); |
1631 | |
1631 | |
1632 | op->destroy (true); |
1632 | op->destroy (); |
1633 | op = tmp; |
1633 | op = tmp; |
1634 | goto inserted; |
1634 | goto inserted; |
1635 | } |
1635 | } |
1636 | |
1636 | |
1637 | op->owner = 0; // it's his/hers now. period. |
1637 | op->owner = 0; // it's his/hers now. period. |
… | |
… | |
2486 | |
2486 | |
2487 | #if 0 |
2487 | #if 0 |
2488 | // remove the "Close old_container" object. |
2488 | // remove the "Close old_container" object. |
2489 | if (object *closer = old_container->inv) |
2489 | if (object *closer = old_container->inv) |
2490 | if (closer->type == CLOSE_CON) |
2490 | if (closer->type == CLOSE_CON) |
2491 | closer->destroy (true); |
2491 | closer->destroy (); |
2492 | #endif |
2492 | #endif |
2493 | |
2493 | |
2494 | // make sure the container is available |
2494 | // make sure the container is available |
2495 | esrv_send_item (this, old_container); |
2495 | esrv_send_item (this, old_container); |
2496 | |
2496 | |
… | |
… | |
2552 | |
2552 | |
2553 | void |
2553 | void |
2554 | object::force_add (const shstr name, int duration) |
2554 | object::force_add (const shstr name, int duration) |
2555 | { |
2555 | { |
2556 | if (object *force = force_find (name)) |
2556 | if (object *force = force_find (name)) |
2557 | force->destroy (true); |
2557 | force->destroy (); |
2558 | |
2558 | |
2559 | object *force = get_archetype (FORCE_NAME); |
2559 | object *force = get_archetype (FORCE_NAME); |
2560 | |
2560 | |
2561 | force->slaying = name; |
2561 | force->slaying = name; |
2562 | force->stats.food = 1; |
2562 | force->stats.food = 1; |