--- deliantra/server/include/map.h 2011/05/08 21:51:26 1.148 +++ deliantra/server/include/map.h 2011/06/03 08:36:45 1.149 @@ -602,6 +602,33 @@ extern dynbuf mapwalk_buf; // can be used in simple non-recursive situations +// special "grave" map used to store all removed objects +// till they can be destroyed - saves a lot of checks in the rest +// of the code +struct freed_map +: maptile +{ + freed_map () + : maptile (3, 3) + { + path = ""; + name = "/internal/freed_objects_map"; + no_drop = 1; + no_reset = 1; + + state = MAP_ACTIVE; + } + + ~freed_map () + { + destroy (); + } +}; + +// initialised in common/shstr.C, due to shstr usage we need defined +// initialisation order! +extern struct freed_map freed_map; // freed objects are moved here to avoid crashes + // loop over every space in the given maprect, // setting m, nx, ny to the map and -coordinate and dx, dy to the offset relative to dx0,dy0 // the iterator code must be a single statement following this macro call, similar to "if"