Revert "Clean up choices if they can't be used."
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
This reverts commit 04cef8b6
This commit is contained in:
parent
04cef8b6e2
commit
20be2815ce
|
@ -22,25 +22,21 @@ void TurnHandler::ExecuteChoice(BaseTurnChoice* choice) {
|
||||||
AssertNotNull(choice);
|
AssertNotNull(choice);
|
||||||
auto choiceKind = choice->GetKind();
|
auto choiceKind = choice->GetKind();
|
||||||
if (choiceKind == TurnChoiceKind::Pass) {
|
if (choiceKind == TurnChoiceKind::Pass) {
|
||||||
delete choice;
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
auto user = choice->GetUser();
|
auto user = choice->GetUser();
|
||||||
// If the user is fainted, we don't want to execute its choice.
|
// If the user is fainted, we don't want to execute its choice.
|
||||||
if (user->IsFainted()) {
|
if (user->IsFainted()) {
|
||||||
delete choice;
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
auto battle = user->GetBattle();
|
auto battle = user->GetBattle();
|
||||||
AssertNotNull(battle)
|
AssertNotNull(battle)
|
||||||
// If the user is not in the field, we don't want to execute its choice.
|
// If the user is not in the field, we don't want to execute its choice.
|
||||||
if (!battle->CreatureInField(user)) {
|
if (!battle->CreatureInField(user)) {
|
||||||
delete choice;
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// If the choice is not valid, we don't want to execute it.
|
// If the choice is not valid, we don't want to execute it.
|
||||||
if (!battle->CanUse(choice)) {
|
if (!battle->CanUse(choice)) {
|
||||||
delete choice;
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue