diff options
-rw-r--r-- | rules.js | 15 |
1 files changed, 13 insertions, 2 deletions
@@ -4677,9 +4677,16 @@ states.spending_bps = { gen_action('end_buildup') }, unit(who) { - if (game.selected < 0) + if (game.selected < 0) { push_undo() - apply_select(who) + game.selected = who + game.changed = 0 + } else { + if (!game.changed) + pop_undo() + else + game.selected = -1 + } }, extra_supply_card() { push_undo() @@ -4691,16 +4698,19 @@ states.spending_bps = { game.state = 'minefield' }, replacement() { + game.changed = 1 log(`Replaced unit.`) replace_unit(game.selected) pay_bps(replacement_cost(game.selected)) }, refit() { + game.changed = 1 log(`Returned for Refit.`) hide_unit(game.selected) set_unit_hex(pop_selected(), friendly_refit()) }, hex(to) { + game.changed = 1 let who = game.selected let from = unit_hex(who) if (to === from) { @@ -4732,6 +4742,7 @@ states.spending_bps = { } }, end_buildup() { + delete game.changed clear_undo() let n = available_bps() |