#include "BattleState.h"
#include "PartyLayout.h"
+#include "states/DefeatState.h"
#include "states/SelectMoveAction.h"
#include "states/PerformAttacks.h"
#include "states/VictoryState.h"
return;
}
if (battle.Defeat()) {
- Ctrl().PopState();
+ if (alreadyPushed) {
+ Ctrl().PopState();
+ } else {
+ Ctrl().PushState(new DefeatState(&battle, this));
+ alreadyPushed = true;
+ }
return;
}
// TODO: this should not push a state while quitting