--- deliantra/server/common/map.C 2008/05/07 11:02:50 1.141 +++ deliantra/server/common/map.C 2008/07/14 16:42:48 1.144 @@ -24,9 +24,7 @@ #include #include "global.h" - #include "loader.h" - #include "path.h" /* This rolls up wall, blocks_magic, blocks_view, etc, all into @@ -262,6 +260,19 @@ tmp->flag [flag] = value; } +void +maptile::post_load_original () +{ + if (!spaces) + return; + + set_object_flag (FLAG_OBJ_ORIGINAL); + + for (mapspace *ms = spaces + size (); ms-- > spaces; ) + for (object *tmp = ms->bot; tmp; tmp = tmp->above) + INVOKE_OBJECT (RESET, tmp); +} + /* link_multipart_objects go through all the objects on the map looking * for objects whose arch says they are multipart yet according to the * info we have, they only have the head (as would be expected when @@ -1044,6 +1055,7 @@ /* All clients need to get re-updated for the change */ update_all_map_los (this); + return 1; } @@ -1056,7 +1068,7 @@ void mapspace::update_ () { - object *tmp, *last = 0; + object *last = 0; uint8 flags = P_UPTODATE, light = 0, anywhere = 0; MoveType move_block = 0, move_slow = 0, move_on = 0, move_off = 0, move_allow = 0; @@ -1068,7 +1080,7 @@ object *&middle = faces_obj[1] = 0; object *&floor = faces_obj[2] = 0; - for (tmp = bot; tmp; last = tmp, tmp = tmp->above) + for (object *tmp = bot; tmp; last = tmp, tmp = tmp->above) { /* This could be made additive I guess (two lights better than * one). But if so, it shouldn't be a simple additive - 2 @@ -1104,6 +1116,7 @@ middle = tmp; anywhere = 1; } + /* Find the highest visible face around. If equal * visibilities, we still want the one nearer to the * top @@ -1162,7 +1175,7 @@ * 3) neither middle or top is set - need to set both. */ - for (tmp = last; tmp; tmp = tmp->below) + for (object *tmp = last; tmp; tmp = tmp->below) { /* Once we get to a floor, stop, since we already have a floor object */ if (QUERY_FLAG (tmp, FLAG_IS_FLOOR)) @@ -1575,9 +1588,6 @@ object * maptile::insert (object *op, int x, int y, object *originator, int flags) { - if (!op->flag [FLAG_REMOVED]) - op->remove (); - return insert_ob_in_map_at (op, this, originator, flags, x, y); }