Revert "Clean up choices if they can't be used."
continuous-integration/drone/push Build is passing Details

This reverts commit 04cef8b6
This commit is contained in:
Deukhoofd 2020-05-29 19:29:25 +02:00
parent 04cef8b6e2
commit 20be2815ce
Signed by: Deukhoofd
GPG Key ID: ADF2E9256009EDCE
1 changed files with 0 additions and 4 deletions

View File

@ -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;
}