--- deliantra/server/common/map.C 2008/05/18 17:52:53 1.142 +++ deliantra/server/common/map.C 2008/09/29 10:20:48 1.147 @@ -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 @@ -342,7 +353,8 @@ else { f.parse_warn (format ("object %s out of range", op->debug_desc ())); - op->destroy (); + op->destroy_inv (false); // be explicit about dropping + op->destroy (true); } } @@ -705,7 +717,7 @@ if (op->head_ () == op && (QUERY_FLAG (op, FLAG_UNIQUE) || unique)) { op->destroy_inv (false); - op->destroy (); + op->destroy (true); } op = above; @@ -806,12 +818,12 @@ if (op == head) { op->destroy_inv (false); - op->destroy (); + op->destroy (true); } else if (head->map != op->map) { LOG (llevDebug, "bad luck for object crossing map borders: %s", head->debug_desc ()); - head->destroy (); + head->destroy (true); } } @@ -927,7 +939,7 @@ /* adjust overall chance below */ if (destroy && rndm (0, 1)) - op->destroy (); + op->destroy (true); } } @@ -1105,6 +1117,7 @@ middle = tmp; anywhere = 1; } + /* Find the highest visible face around. If equal * visibilities, we still want the one nearer to the * top