]> git.localhorst.tv Git - l2e.git/blobdiff - src/battle/BattleState.cpp
added simple victory state
[l2e.git] / src / battle / BattleState.cpp
index a17732ca8c612c0c3bc810d46c73050e491e46d6..1f68acfa8bf05576202233639e008bc0d31d0c43 100644 (file)
@@ -3,6 +3,7 @@
 #include "PartyLayout.h"
 #include "states/SelectMoveAction.h"
 #include "states/PerformAttacks.h"
+#include "states/VictoryState.h"
 #include "../app/Application.h"
 #include "../app/Input.h"
 #include "../common/GameState.h"
@@ -119,7 +120,12 @@ void BattleState::OnResumeState(SDL_Surface *screen) {
                return;
        }
        if (battle.Victory()) {
-               Ctrl().PopState();
+               if (alreadyPushed) {
+                       Ctrl().PopState();
+               } else {
+                       Ctrl().PushState(new VictoryState(&battle, this));
+                       alreadyPushed = true;
+               }
                return;
        }
        if (battle.Defeat()) {