diff options
author | Tor Andersson <tor@ccxvii.net> | 2023-02-18 01:42:19 +0100 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2023-02-18 13:02:40 +0100 |
commit | dfd3c5d2237016b630885a0d78b9b3a6aed05611 (patch) | |
tree | ee25a6675fbf8dd55de372e5e136be5e51059430 | |
parent | 61c16c14e65695d8f1c7808f29948eac94975a6b (diff) | |
download | nevsky-dfd3c5d2237016b630885a0d78b9b3a6aed05611.tar.gz |
Fix graying out of ambushed lords.
-rw-r--r-- | play.js | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -271,15 +271,17 @@ function is_lord_on_left_or_right(lord) { function is_lord_ambushed(lord) { if (view.battle) { + // ambush & 2 = attacker played ambush + // ambush & 1 = defender played ambush if (view.battle.attacker === "Teutons") { - if ((view.battle.ambush & 2) && is_p1_lord(lord)) + if ((view.battle.ambush & 1) && is_p1_lord(lord)) return is_lord_on_left_or_right(lord) - if ((view.battle.ambush & 1) && is_p2_lord(lord)) + if ((view.battle.ambush & 2) && is_p2_lord(lord)) return is_lord_on_left_or_right(lord) } else { - if ((view.battle.ambush & 2) && is_p2_lord(lord)) + if ((view.battle.ambush & 1) && is_p2_lord(lord)) return is_lord_on_left_or_right(lord) - if ((view.battle.ambush & 1) && is_p1_lord(lord)) + if ((view.battle.ambush & 2) && is_p1_lord(lord)) return is_lord_on_left_or_right(lord) } } |