[Fix] Map will now always close on new/load game.

This commit is contained in:
Allanis 2013-12-31 18:38:38 +00:00
parent 9a60a3d062
commit fae31ac95f
3 changed files with 6 additions and 5 deletions

View File

@ -37,7 +37,6 @@ extern int systems_nstack;
extern int planet_target;
extern int hyperspace_target;
static void map_close(char* str);
static void map_update(void);
static int map_inPath(StarSystem* sys);
static void map_render(double bx, double by, double w, double h);
@ -48,7 +47,7 @@ static void map_selectCur(void);
/* Open the map window. */
void map_open(void) {
if(map_wid) {
map_close(NULL);
map_close();
return;
}
@ -121,7 +120,7 @@ void map_open(void) {
/* Close button. */
window_addButton(map_wid, -20, 20, BUTTON_WIDTH, BUTTON_HEIGHT,
"btnClose", "Close", map_close);
"btnClose", "Close", (void(*)(char*))map_close);
/* The map itself. */
window_addCust(map_wid, 20, -40, MAP_WIDTH, MAP_HEIGHT,
@ -142,8 +141,7 @@ void map_open(void) {
map_update();
}
static void map_close(char* str) {
(void)str;
void map_close(void) {
if(map_wid) {
window_destroy(map_wid);
map_wid = 0;

View File

@ -3,6 +3,7 @@
/* Open the map window. */
void map_open(void);
void map_close(void);
int map_isOpen(void);
/* Misc. */

View File

@ -247,6 +247,7 @@ void player_new(void) {
land_cleanup();
diff_clear();
factions_reset();
map_close();
player_name = dialogue_input("Player Name", 3, 20,
"Please tell me your name:");
@ -2228,6 +2229,7 @@ int player_load(xmlNodePtr parent) {
player_cleanup();
var_cleanup();
missions_cleanup();
map_close();
node = parent->xmlChildrenNode;