Fixed bug in feature ending a round at the end of a combat that caused

an infinite recursion (Stack overflow) when the combat ended due to
player death while afflicted by an actor condition.
This commit is contained in:
Zukero
2017-08-21 14:40:46 +02:00
parent acf15e5b6d
commit d15e15a897
2 changed files with 7 additions and 3 deletions

View File

@@ -41,7 +41,7 @@
android:orientation="vertical"
android:gravity="left"
>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"

View File

@@ -55,9 +55,14 @@ public final class CombatController implements VisualEffectCompletedCallback {
public void exitCombat(boolean pickupLootBags) {
setCombatSelection(null, null);
world.model.uiSelections.isInCombat = false;
combatTurnListeners.onCombatEnded();
world.model.uiSelections.selectedPosition = null;
world.model.uiSelections.selectedMonster = null;
endOfCombatRound();
if (world.model.player.isDead()) {
controllers.gameRoundController.resetRoundTimers();
} else {
endOfCombatRound();
}
if (pickupLootBags && totalExpThisFight > 0) {
controllers.itemController.lootMonsterBags(killedMonsterBags, totalExpThisFight);
} else {
@@ -557,7 +562,6 @@ public final class CombatController implements VisualEffectCompletedCallback {
}
public void endOfCombatRound() {
combatTurnListeners.onCombatEnded();
world.model.worldData.tickWorldTime();
controllers.gameRoundController.resetRoundTimers();
controllers.actorStatsController.applyConditionsToPlayer(world.model.player, false);