summaryrefslogtreecommitdiff
path: root/rules.js
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2022-05-02 16:30:13 +0200
committerTor Andersson <tor@ccxvii.net>2023-02-18 11:54:52 +0100
commit640d10a281b619a34758232d1ea16df0c87e5bce (patch)
tree0d8c66495888fc15f87978606df1c676ef03f63a /rules.js
parent61aeacc64402baf97dfefcee7e430433d8ada797 (diff)
downloadwilderness-war-640d10a281b619a34758232d1ea16df0c87e5bce.tar.gz
Set up retreat state for retreat_attacker even when no units survived.
Diffstat (limited to 'rules.js')
-rw-r--r--rules.js7
1 files changed, 5 insertions, 2 deletions
diff --git a/rules.js b/rules.js
index 25df035..3d180cd 100644
--- a/rules.js
+++ b/rules.js
@@ -5166,10 +5166,12 @@ function determine_winner_battle() {
if (victor === game.battle.attacker) {
goto_raid_events();
} else {
- if (game.battle.atk_pcs.length > 0)
+ if (game.battle.atk_pcs.length > 0) {
+ retreat_attacker(game.raid.where, game.raid.from[game.raid.where] | 0);
+ } else {
retreat_attacker(game.raid.where, game.raid.from[game.raid.where] | 0);
- else
end_retreat_attacker(game.raid.from[game.raid.where]);
+ }
}
return;
}
@@ -5205,6 +5207,7 @@ function determine_winner_battle() {
unstack_force(moving_piece());
retreat_attacker(game.battle.where, moving_piece_came_from());
} else {
+ retreat_attacker(game.battle.where, moving_piece_came_from());
end_retreat_attacker(moving_piece_came_from());
}
}