From 5985c3e7f63a62503bc284e0da6197861b606f16 Mon Sep 17 00:00:00 2001 From: Linus Probert Date: Wed, 24 Oct 2018 16:12:51 +0200 Subject: [PATCH] Fixed a bad pointer reset --- src/main.c | 34 +++++++++++++++++++--------------- 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/src/main.c b/src/main.c index 75b2327..f6c3232 100644 --- a/src/main.c +++ b/src/main.c @@ -512,27 +512,31 @@ resetGame(void) { SDL_FlushEvents(SDL_FIRSTEVENT, SDL_LASTEVENT); - if (mainMenu) + if (mainMenu) { menu_destroy(mainMenu); - mainMenu = NULL; - if (charSelectMenu) + mainMenu = NULL; + } + if (charSelectMenu) { menu_destroy(charSelectMenu); - charSelectMenu = NULL; - if (characterSelectScreen) + charSelectMenu = NULL; + } + if (characterSelectScreen) { screen_destroy(characterSelectScreen); - charSelectMenu = NULL; - - if (creditsScreen) + characterSelectScreen = NULL; + } + if (creditsScreen) { screen_destroy(creditsScreen); - creditsScreen = NULL; - - if (scoreScreen) + creditsScreen = NULL; + } + if (scoreScreen) { screen_destroy(scoreScreen); - scoreScreen = NULL; - - if (inGameMenu) + scoreScreen = NULL; + } + if (inGameMenu) { menu_destroy(inGameMenu); - inGameMenu = NULL; + inGameMenu = NULL; + } + initInGameMenu(); if (gMap)