diff options
author | teisuru <31881306+teisuru@users.noreply.github.com> | 2024-01-17 14:34:35 +0100 |
---|---|---|
committer | teisuru <31881306+teisuru@users.noreply.github.com> | 2024-01-17 14:34:35 +0100 |
commit | d4774e63860985a92ed8b2d449864b4647d983f6 (patch) | |
tree | c4625980c6bf8896182258684a6db61212d4259b | |
parent | b446b7f31d0b6e965362369f85ac6c812b451c2d (diff) | |
download | plantagenet-d4774e63860985a92ed8b2d449864b4647d983f6.tar.gz |
Fuzzer fix clear_undo & game.where
Unset game.where after supply and clear_undo after set_active_enemy
-rw-r--r-- | rules.js | 13 |
1 files changed, 10 insertions, 3 deletions
@@ -709,8 +709,12 @@ function set_active(new_active) { } } -function set_active_enemy() { - set_active(enemy_player()) +function set_active(new_active) { + if (game.active !== new_active) { + clear_undo() // here + game.active = new_active + update_aliases() + } } function enemy_player() { @@ -5887,6 +5891,7 @@ function goto_intercept() { function end_intercept() { game.intercept_group = 0 game.who = NOBODY + clear_undo() set_active_enemy() goto_exiles() } @@ -6026,6 +6031,7 @@ function goto_intercept_exiles() { } function end_intercept_exiles() { + clear_undo() set_active_enemy() end_intercept() } @@ -6396,9 +6402,11 @@ states.select_supply_type = { }, stronghold() { use_stronghold_supply(game.where, get_stronghold_supply_amount(game.where)) + game.where = NOWHERE }, port() { use_port_supply(game.where, get_port_supply_amount(game.where)) + game.where = NOWHERE }, } @@ -7844,7 +7852,6 @@ function end_flee() { end_battle_round() return } - set_active_enemy() if (game.active !== game.battle.attacker) { |