From 413caa41305cf4a1911e1163c2a44633ce582d38 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Thu, 17 Oct 2024 21:43:14 +0200 Subject: Stable Take/Drop CU buttons. --- rules.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'rules.js') diff --git a/rules.js b/rules.js index eb68fd1..54aaeac 100644 --- a/rules.js +++ b/rules.js @@ -2383,11 +2383,23 @@ function path_type(from, to) { function gen_carry_cu() { let where = location_of_general(game.move.who) if (game.active === P_BRITAIN) { + view.actions.drop_british_cu = 0 + view.actions.pickup_british_cu = 0 + if (game.move.carry_british > 0) view.actions.drop_british_cu = 1 if (game.move.carry_british < 5 && game.move.carry_british < count_unmoved_british_cu(where)) view.actions.pickup_british_cu = 1 } else { + if (game.move.carry_french > 0 || count_french_cu(where) > 0) { + view.actions.drop_french_cu = 0 + view.actions.pickup_french_cu = 0 + } + if (game.move.carry_american > 0 || count_american_cu(where) > 0) { + view.actions.drop_american_cu = 0 + view.actions.pickup_american_cu = 0 + } + let carry_total = game.move.carry_french + game.move.carry_american if (game.move.carry_french > 0) view.actions.drop_french_cu = 1 -- cgit v1.2.3