From 76270a4a54f60d94a70c381e2e37a3c79c962ab1 Mon Sep 17 00:00:00 2001 From: David Lancashire Date: Wed, 24 Jan 2024 01:37:41 +0700 Subject: [PATCH] fix: minor patches --- mods/his/his.js | 44 +++++++++++++++++++++++++++++--------- mods/his/src/his-player.js | 44 +++++++++++++++++++++++++++++--------- 2 files changed, 68 insertions(+), 20 deletions(-) diff --git a/mods/his/his.js b/mods/his/his.js index b428759c5b..78bb4d2893 100644 --- a/mods/his/his.js +++ b/mods/his/his.js @@ -28395,17 +28395,39 @@ return; let space = his_self.game.spaces[spacekey]; + his_self.field_battle_overlay.hide(); + + his_self.playerSelectSpaceWithFilter( + + "Choose Destination for Retreat:" , + + function(space2) { + if (space.neighbours.includes(space2.key)) { + if (loser === attacker) { + if (space2.key === attacker_comes_from_this_spacekey) { + return 1; + } + } else { + if (his_self.canFactionRetreatToSpace(loser, space2.key, "") && space2.key !== attacker_comes_from_this_spacekey) { + return 1; + } + } + } + }, + + function(spacekey) { + onFinishSelect(his_self, spacekey); + }, + + null, + + true + + ); + +/**** + let html = ""; @@ -28417,6 +28439,8 @@ return; onFinishSelect(his_self, id); }); +***/ + }; diff --git a/mods/his/src/his-player.js b/mods/his/src/his-player.js index 2150f1985f..f3b0673211 100644 --- a/mods/his/src/his-player.js +++ b/mods/his/src/his-player.js @@ -2876,17 +2876,39 @@ return; let space = his_self.game.spaces[spacekey]; + his_self.field_battle_overlay.hide(); + + his_self.playerSelectSpaceWithFilter( + + "Choose Destination for Retreat:" , + + function(space2) { + if (space.neighbours.includes(space2.key)) { + if (loser === attacker) { + if (space2.key === attacker_comes_from_this_spacekey) { + return 1; + } + } else { + if (his_self.canFactionRetreatToSpace(loser, space2.key, "") && space2.key !== attacker_comes_from_this_spacekey) { + return 1; + } + } + } + }, + + function(spacekey) { + onFinishSelect(his_self, spacekey); + }, + + null, + + true + + ); + +/**** + let html = ""; @@ -2898,6 +2920,8 @@ return; onFinishSelect(his_self, id); }); +***/ + };