--- deliantra/server/common/object.C 2008/05/07 13:38:16 1.239 +++ deliantra/server/common/object.C 2008/05/07 19:19:09 1.241 @@ -1312,12 +1312,16 @@ if (flag & INS_BELOW_ORIGINATOR) { - if (originator->map != op->map || originator->x != op->x || originator->y != op->y || !originator->is_on_map ()) + if (originator->map != op->map || originator->x != op->x || originator->y != op->y) { LOG (llevError, "insert_ob_in_map called with INS_BELOW_ORIGINATOR when originator not on same space!\n"); abort (); } + if (!originator->is_on_map ()) + LOG (llevDebug | logBacktrace, "insert_ob_in_map(%s) called with INS_BELOW_ORIGINATOR when originator '%s' not on map", + op->debug_desc (), originator->debug_desc ()); + op->above = originator; op->below = originator->below; originator->below = op; @@ -1393,10 +1397,7 @@ if (flag & INS_ABOVE_FLOOR_ONLY) top = floor; - /* Top is the object that our object (op) is going to get inserted above. - */ - - /* no top found, insert at bottom */ + // insert object above top, or bottom-most if top = 0 if (!top) { op->below = 0; @@ -1406,14 +1407,14 @@ *(op->above ? &op->above->below : &ms.top) = op; } else - { /* get inserted into the stack above top */ + { op->above = top->above; top->above = op; op->below = top; *(op->above ? &op->above->below : &ms.top) = op; } - } /* else not INS_BELOW_ORIGINATOR */ + } if (op->type == PLAYER) {