diff options
author | Tor Andersson <tor@ccxvii.net> | 2023-12-10 23:45:17 +0100 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2023-12-10 23:45:17 +0100 |
commit | db5719847c9397bc96081ec805354a3dca61a1dd (patch) | |
tree | 5f74fd7a640a66bda9a8a861ffb1e900b992aa5a | |
parent | d47baf1c5e9d0792fb17cd7e58cf9b7ca05058c2 (diff) | |
download | nevsky-db5719847c9397bc96081ec805354a3dca61a1dd.tar.gz |
Only check front choice / rear choice asserts if using that choice.
There may still be a potential problem lurking in strike_left_right
or assign_left_right when both fc and rc are unset, and only fc is
assigned...
-rw-r--r-- | rules.js | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -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 } |