--- deliantra/server/common/object.C 2008/09/29 09:04:50 1.258 +++ deliantra/server/common/object.C 2008/12/20 16:29:41 1.263 @@ -911,7 +911,7 @@ || ms ().move_block == MOVE_ALL) { while (inv) - inv->destroy (true); + inv->destroy (); } else { /* Put objects in inventory onto this space */ @@ -925,7 +925,7 @@ || op->type == TRAP || op->flag [FLAG_IS_A_TEMPLATE] || op->flag [FLAG_DESTROY_ON_DEATH]) - op->destroy (true); + op->destroy (); else map->insert (op, x, y); } @@ -985,7 +985,7 @@ if (more) { - more->destroy (true); + more->destroy (); more = 0; } @@ -999,7 +999,7 @@ } void -object::destroy (bool destroy_inventory) +object::destroy () { if (destroyed ()) return; @@ -1007,11 +1007,11 @@ if (!is_head () && !head->destroyed ()) { LOG (llevError | logBacktrace, "tried to destroy the tail of an object"); - head->destroy (destroy_inventory); + head->destroy (); return; } - destroy_inv (!destroy_inventory); + destroy_inv (false); if (is_head ()) if (sound_destroy) @@ -1159,7 +1159,7 @@ last = tmp; } - if (flag [FLAG_BLOCKSVIEW] || glow_radius) + if (glow_radius || flag [FLAG_BLOCKSVIEW]) update_all_los (map, x, y); } } @@ -1193,7 +1193,7 @@ op->weight = 0; // cancel the addition above op->carrying = 0; // must be 0 already - op->destroy (true); + op->destroy (); return top; } @@ -1265,17 +1265,7 @@ object * insert_ob_in_map (object *op, maptile *m, object *originator, int flag) { - if (op->is_on_map ()) - { - LOG (llevError, "insert_ob_in_map called for object already on map"); - abort (); - } - - if (op->env) - { - LOG (llevError, "insert_ob_in_map called for object in an inventory (proceeding)"); - op->remove (); - } + op->remove (); if (m == &freed_map)//D TODO: remove soon {//D @@ -1288,7 +1278,7 @@ */ if (!xy_normalise (m, op->x, op->y)) { - op->head_ ()->destroy (true);// remove head_ once all tail object destroyers found + op->head_ ()->destroy ();// remove head_ once all tail object destroyers found return 0; } @@ -1311,7 +1301,7 @@ // but some caller surely breaks when we return tmp // from here :/ op->nrof += tmp->nrof; - tmp->destroy (true); + tmp->destroy (); } CLEAR_FLAG (op, FLAG_APPLIED); /* hack for fixing F_APPLIED in items of dead people */ @@ -1451,7 +1441,7 @@ * or just updating the P_UPTODATE for spaces within this area * of effect may be sufficient. */ - if (op->map->darkness && (op->glow_radius != 0)) + if (op->map->darkness && (op->glow_radius || op->flag [FLAG_BLOCKSVIEW])) update_all_los (op->map, op->x, op->y); /* updates flags (blocked, alive, no magic, etc) for this map space */ @@ -1496,7 +1486,7 @@ for (object *tmp = op->ms ().bot; tmp; tmp = tmp->above) if (!strcmp (tmp->arch->archname, arch_string)) /* same archetype */ - tmp->destroy (true); + tmp->destroy (); object *tmp = arch_to_object (archetype::find (arch_string)); @@ -1629,7 +1619,7 @@ adjust_weight (this, op->total_weight ()); - op->destroy (true); + op->destroy (); op = tmp; goto inserted; } @@ -1973,7 +1963,7 @@ if (OB_TYPE_MOVE_BLOCK (ob, ms.move_block)) continue; - if (ob->blocked (m, pos.x, pos.y)) + if (ob->blocked (pos.m, pos.x, pos.y)) continue; altern [index++] = i; @@ -2488,7 +2478,7 @@ // remove the "Close old_container" object. if (object *closer = old_container->inv) if (closer->type == CLOSE_CON) - closer->destroy (true); + closer->destroy (); #endif // make sure the container is available @@ -2554,7 +2544,7 @@ object::force_add (const shstr name, int duration) { if (object *force = force_find (name)) - force->destroy (true); + force->destroy (); object *force = get_archetype (FORCE_NAME);