--- deliantra/server/common/object.C 2008/04/22 23:50:23 1.216 +++ deliantra/server/common/object.C 2008/04/23 07:25:54 1.218 @@ -919,7 +919,7 @@ // need to check first, because the checks below might segfault // as we might be on an invalid mapspace and crossfire code // is too buggy to ensure that the inventory is empty. - // corollary: if you create arrows etc. with stuff in tis inventory, + // corollary: if you create arrows etc. with stuff in its inventory, // cf will crash below with off-map x and y if (!inv) return; @@ -936,7 +936,7 @@ { while (inv) { - inv->destroy_inv (drop_to_ground); + inv->destroy_inv (false); inv->destroy (); } } @@ -952,7 +952,7 @@ || op->type == TRAP || op->flag [FLAG_IS_A_TEMPLATE] || op->flag [FLAG_DESTROY_ON_DEATH]) - op->destroy (); + op->destroy (true); else map->insert (op, x, y); } @@ -979,8 +979,6 @@ attachable::do_destroy (); - destroy_inv (true); - deactivate (); unlink (); @@ -1030,8 +1028,7 @@ if (destroyed ()) return; - if (destroy_inventory) - destroy_inv (false); + destroy_inv (!destroy_inventory); if (is_head ()) if (sound_destroy) @@ -1154,7 +1151,8 @@ */ pl->close_container (); - pl->contr->ns->floorbox_update (); + //TODO: the floorbox prev/next might need updating + esrv_del_item (pl->contr, count); } for (tmp = ms.bot; tmp; tmp = tmp->above) @@ -1290,8 +1288,6 @@ { assert (!op->flag [FLAG_FREED]); - object *top, *floor = NULL; - op->remove (); /* Ideally, the caller figures this out. However, it complicates a lot @@ -1300,7 +1296,7 @@ */ if (!xy_normalise (m, op->x, op->y)) { - op->destroy (); + op->destroy (1); return 0; } @@ -1319,6 +1315,9 @@ for (object *tmp = ms.bot; tmp; tmp = tmp->above) if (object::can_merge (op, tmp)) { + // TODO: we atcually want to update tmp, not op, + // but some caller surely breaks when we return tmp + // from here :/ op->nrof += tmp->nrof; tmp->destroy (1); } @@ -1350,6 +1349,8 @@ } else { + object *top, *floor = NULL; + top = ms.bot; /* If there are other objects, then */ @@ -1458,7 +1459,8 @@ op->map->dirty = true; if (object *pl = ms.player ()) - pl->contr->ns->floorbox_update (); + //TODO: the floorbox prev/next might need updating + esrv_send_item (pl, op); /* If this object glows, it may affect lighting conditions that are * visible to others on this map. But update_all_los is really @@ -2569,7 +2571,7 @@ title ? (const char *)title : "", flag_desc (flagdesc, 512), type); - if (!this->flag[FLAG_REMOVED] && env) + if (!flag[FLAG_REMOVED] && env) p += snprintf (p, 256, "(in %s)", env->debug_desc (info2)); if (map)