--- deliantra/server/common/map.C 2006/12/25 14:54:44 1.49 +++ deliantra/server/common/map.C 2006/12/25 15:28:35 1.50 @@ -1291,12 +1291,12 @@ m->in_memory = MAP_LOADING; if (m->tmpname == NULL) /* if we have loaded unique items from */ delete_unique_items (m); /* original map before, don't duplicate them */ + load_objects (m, thawer, 0); m->in_memory = MAP_IN_MEMORY; } - /* * Saves a map to file. If flag is set, it is saved into the same * file it was (originally) loaded from. Otherwise a temporary @@ -1305,7 +1305,6 @@ * If the map is unique, we also save to the filename in the map * (this should have been updated when first loaded) */ - int new_save_map (maptile *m, int flag) { @@ -1479,47 +1478,35 @@ void free_map (maptile *m, int flag) { - if (m->in_memory != MAP_IN_MEMORY) + if (!m->in_memory) //TODO: makes no sense to me? return; m->in_memory = MAP_SAVING; // TODO: use new/delete -#define FREE_AND_CLEAR(p) { free (p); p = NULL; } if (flag && m->spaces) free_all_objects (m); - if (m->name) - FREE_AND_CLEAR (m->name); - if (m->spaces) - FREE_AND_CLEAR (m->spaces); - if (m->msg) - FREE_AND_CLEAR (m->msg); - if (m->maplore) - FREE_AND_CLEAR (m->maplore); - - delete [] m->shopitems; - m->shopitems = 0; - if (m->shoprace) - FREE_AND_CLEAR (m->shoprace); + free (m->name), m->name = 0; + free (m->spaces), m->spaces = 0; + free (m->msg), m->msg = 0; + free (m->maplore), m->maplore = 0; + free (m->shoprace), m->shoprace = 0; + delete [] m->shopitems, m->shopitems = 0; if (m->buttons) - free_objectlinkpt (m->buttons); - - m->buttons = NULL; + free_objectlinkpt (m->buttons), m->buttons = 0; for (int i = 0; i < 4; i++) { if (m->tile_path[i]) - FREE_AND_CLEAR (m->tile_path[i]); + free (m->tile_path[i]), m->tile_path[i] = 0; m->tile_map[i] = 0; } m->in_memory = MAP_SWAPPED; - -#undef FREE_AND_CLEAR } maptile::~maptile ()