summaryrefslogtreecommitdiff
path: root/rules.js
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2023-02-03 19:33:37 +0100
committerTor Andersson <tor@ccxvii.net>2023-02-18 13:02:39 +0100
commitb1951a63f712c22baab1a8bf45118ce7c62c8079 (patch)
tree5cfc8c2d3d0628b518a1869d368389b9c0e52e4d /rules.js
parent9c1cee8f4ad47a164fb897d85ee61e234c85a0f1 (diff)
downloadnevsky-b1951a63f712c22baab1a8bf45118ce7c62c8079.tar.gz
Fix bug when 1 defending lord withdraws, and is victorious.
Diffstat (limited to 'rules.js')
-rw-r--r--rules.js7
1 files changed, 7 insertions, 0 deletions
diff --git a/rules.js b/rules.js
index 396b527..1f039d0 100644
--- a/rules.js
+++ b/rules.js
@@ -9480,6 +9480,13 @@ function retreat_2() {
lift_sieges()
remove_legate_if_endangered(game.battle.where)
+ // TODO: clean up ...
+ // Release victorious lords who withdrew before battle...
+ if (is_enemy_stronghold(game.battle.where) && !has_friendly_lord(game.battle.where) && !has_siege_marker(game.battle.where))
+ release_besieged_lords(game.battle.where)
+ if (is_friendly_stronghold(game.battle.where) && !has_enemy_lord(game.battle.where) && !has_siege_marker(game.battle.where))
+ release_besieged_lords(game.battle.where)
+
game.battle.retreat_to = 0
game.battle.retreat_way = 0
end_retreat()