From 20be2815ce481e2b271d9577dd56a7f45c65d8b2 Mon Sep 17 00:00:00 2001 From: Deukhoofd Date: Fri, 29 May 2020 19:29:25 +0200 Subject: [PATCH] Revert "Clean up choices if they can't be used." This reverts commit 04cef8b6 --- src/Battling/Flow/TurnHandler.cpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/Battling/Flow/TurnHandler.cpp b/src/Battling/Flow/TurnHandler.cpp index 4212920..0e7de56 100644 --- a/src/Battling/Flow/TurnHandler.cpp +++ b/src/Battling/Flow/TurnHandler.cpp @@ -22,25 +22,21 @@ void TurnHandler::ExecuteChoice(BaseTurnChoice* choice) { AssertNotNull(choice); auto choiceKind = choice->GetKind(); if (choiceKind == TurnChoiceKind::Pass) { - delete choice; return; } auto user = choice->GetUser(); // If the user is fainted, we don't want to execute its choice. if (user->IsFainted()) { - delete choice; return; } auto battle = user->GetBattle(); AssertNotNull(battle) // If the user is not in the field, we don't want to execute its choice. if (!battle->CreatureInField(user)) { - delete choice; return; } // If the choice is not valid, we don't want to execute it. if (!battle->CanUse(choice)) { - delete choice; return; }