diff --git a/game/automap.c b/game/automap.c index 754f867..b6c03f9 100644 --- a/game/automap.c +++ b/game/automap.c @@ -1109,3 +1109,9 @@ void free_map_description() { if (texty_v_mape!=NULL)release_list(texty_v_mape); texty_v_mape = NULL; } + +TSTR_LIST swap_map_description(TSTR_LIST new_list) { + TSTR_LIST old = texty_v_mape; + texty_v_mape = new_list; + return old; +} \ No newline at end of file diff --git a/game/globals.h b/game/globals.h index ec3fe1d..db843d4 100644 --- a/game/globals.h +++ b/game/globals.h @@ -1402,7 +1402,7 @@ void destroy_all_fly(); void stop_fly(LETICI_VEC *p,char zvuk); void herni_cas(char *s); - +typedef char **TSTR_LIST; //gamesaver void leave_current_map(void); @@ -1415,6 +1415,7 @@ int save_game(long game_time,char *gamename, char is_autosave); void save_map_description(TMPFILE_WR *f); void load_map_description(TMPFILE_RD *f); void free_map_description(); +TSTR_LIST swap_map_description(TSTR_LIST new_list); void wire_save_load(char save); void do_save_dialog(); char ask_save_dialog(char *name_buffer, size_t name_size, char allow_remove); diff --git a/game/globmap.c b/game/globmap.c index bb016e9..ab52d1d 100644 --- a/game/globmap.c +++ b/game/globmap.c @@ -630,6 +630,7 @@ struct _tag_map_save_state{ TSTENA *_map_sides; TSECTOR *_map_sectors; TMAP_EDIT_INFO *_map_coord; + TSTR_LIST _map_desc; int _map_size; int _viewsector; int _viewdir; @@ -647,6 +648,7 @@ static void save_current_map() { save_state._map_coord = map_coord; save_state._map_sectors = map_sectors; save_state._map_size = mapsize; + save_state._map_desc = swap_map_description(NULL); save_state._viewsector = viewsector; save_state._viewdir = viewdir; save_state._hash = current_map_hash; @@ -661,6 +663,7 @@ static void restore_saved_map() { free(map_sides); free(map_sectors); free(map_coord); + free_map_description(); mapsize =save_state._map_size; map_sides = save_state._map_sides; map_sectors = save_state._map_sectors; @@ -668,9 +671,11 @@ static void restore_saved_map() { viewsector = save_state._viewsector; viewdir = save_state._viewdir; current_map_hash = save_state._hash; + swap_map_description(save_state._map_desc); save_state._map_sides = NULL; save_state._map_coord = NULL; save_state._map_sectors = NULL; + save_state._map_desc = NULL; } }