summaryrefslogtreecommitdiff
path: root/rules.js
diff options
context:
space:
mode:
Diffstat (limited to 'rules.js')
-rw-r--r--rules.js9
1 files changed, 6 insertions, 3 deletions
diff --git a/rules.js b/rules.js
index cb00bc0..5568525 100644
--- a/rules.js
+++ b/rules.js
@@ -8220,12 +8220,15 @@ function find_closest_target(A, B, C) {
}
function find_closest_target_center(T2) {
- if (game.battle.fc < 0) throw Error("unset front l/r choice")
- if (game.battle.rc < 0) throw Error("unset rear l/r choice")
if (filled(T2))
return T2
- if (T2 >= A1 && T2 <= D3)
+ if (T2 >= A1 && T2 <= D3) {
+ if (game.battle.fc < 0)
+ throw Error("unset front l/r choice")
return game.battle.fc
+ }
+ if (game.battle.rc < 0)
+ throw Error("unset rear l/r choice")
return game.battle.rc
}