Fixed a bad pointer reset

This commit is contained in:
Linus Probert 2018-10-24 16:12:51 +02:00
parent 9968b377a5
commit 5985c3e7f6
1 changed files with 19 additions and 15 deletions

View File

@ -512,27 +512,31 @@ resetGame(void)
{ {
SDL_FlushEvents(SDL_FIRSTEVENT, SDL_LASTEVENT); SDL_FlushEvents(SDL_FIRSTEVENT, SDL_LASTEVENT);
if (mainMenu) if (mainMenu) {
menu_destroy(mainMenu); menu_destroy(mainMenu);
mainMenu = NULL; mainMenu = NULL;
if (charSelectMenu) }
if (charSelectMenu) {
menu_destroy(charSelectMenu); menu_destroy(charSelectMenu);
charSelectMenu = NULL; charSelectMenu = NULL;
if (characterSelectScreen) }
if (characterSelectScreen) {
screen_destroy(characterSelectScreen); screen_destroy(characterSelectScreen);
charSelectMenu = NULL; characterSelectScreen = NULL;
}
if (creditsScreen) if (creditsScreen) {
screen_destroy(creditsScreen); screen_destroy(creditsScreen);
creditsScreen = NULL; creditsScreen = NULL;
}
if (scoreScreen) if (scoreScreen) {
screen_destroy(scoreScreen); screen_destroy(scoreScreen);
scoreScreen = NULL; scoreScreen = NULL;
}
if (inGameMenu) if (inGameMenu) {
menu_destroy(inGameMenu); menu_destroy(inGameMenu);
inGameMenu = NULL; inGameMenu = NULL;
}
initInGameMenu(); initInGameMenu();
if (gMap) if (gMap)