From 2bead9ba196c4b66e8f8c887946368e108f1b8be Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Sat, 26 Nov 2022 11:39:56 +0100 Subject: Fix placing Amherst, Forbes, and Wolfe into pool twice! If William Pitt is played after 1758 when the scenario rules have already placed them into the pool, don't put them back in. --- rules.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/rules.js b/rules.js index dbd8873..f3ee05e 100644 --- a/rules.js +++ b/rules.js @@ -2103,7 +2103,9 @@ function find_closest_friendly_unbesieged_fortification(start) { // SEQUENCE OF PLAY -function place_amherst_forbes_and_wolfe_in_pool() { +function place_amherst_forbes_and_wolfe_in_pool(is_event) { + if (is_event && game.year >= 1759) + return log("Placed Amherst, Forbes, and Wolfe into the British leader pool.") game.british.pool.push(AMHERST) game.british.pool.push(FORBES) @@ -2111,8 +2113,6 @@ function place_amherst_forbes_and_wolfe_in_pool() { } function start_year() { - if (game.year === 1759 && !game.events.pitt) - place_amherst_forbes_and_wolfe_in_pool() game.season = EARLY start_season() } @@ -2131,6 +2131,9 @@ function start_season() { break } + if (game.year === 1759 && game.season === EARLY && !game.events.pitt) + place_amherst_forbes_and_wolfe_in_pool(false) + delete game.british.pass_fw delete game.british.pass_bh delete game.french.pass_fw @@ -8897,7 +8900,7 @@ events.william_pitt = { game.events.pitt = 1 game.state = 'william_pitt' game.count = 1 - place_amherst_forbes_and_wolfe_in_pool() + place_amherst_forbes_and_wolfe_in_pool(true) } } -- cgit v1.2.3