--- deliantra/server/common/object.C 2008/05/17 00:17:02 1.243 +++ deliantra/server/common/object.C 2008/05/18 19:53:07 1.245 @@ -1243,6 +1243,8 @@ object * insert_ob_in_map_at (object *op, maptile *m, object *originator, int flag, int x, int y) { + op->remove (); + for (object *tmp = op->head_ (); tmp; tmp = tmp->more) { tmp->x = x + tmp->arch->x; @@ -1275,7 +1277,23 @@ object * insert_ob_in_map (object *op, maptile *m, object *originator, int flag) { - op->remove (); + 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 (); + } + + if (op->face && !face_info (op->face))//D TODO: remove soon + {//D + LOG (llevError | logBacktrace, "op->face out of bounds: %s", op->debug_desc ());//D + op->face = 1;//D + }//D /* Ideally, the caller figures this out. However, it complicates a lot * of areas of callers (eg, anything that uses find_free_spot would now