From 322a3e9f6e0985b1b180bc4bec5db2b1ae05d52e Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Sat, 2 Nov 2024 10:24:24 +0100 Subject: fix who approves subsidy contract --- rules.js | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/rules.js b/rules.js index 1b80525..2faf7fa 100644 --- a/rules.js +++ b/rules.js @@ -5582,6 +5582,15 @@ function end_imperial_election() { /* SUBSIDY CONTRACTS - CREATE */ +function may_create_subsidy() { + if (is_two_player()) { + let major = coop_major_power(game.power) + if (major === P_PRAGMATIC || major === P_AUSTRIA) + return is_saxony_austrian_ally() + } + return true +} + function goto_propose_subsidy() { game.proposal = { save_power: game.power, save_state: game.state, from: -1, to: -1, n: 0 } game.state = "propose_subsidy_from" @@ -5632,7 +5641,10 @@ states.propose_subsidy_length = { }, value(n) { game.proposal.n = n - set_active_to_power(game.proposal.from) + if (is_controlled_power(game.power, game.proposal.from)) + set_active_to_power(game.proposal.to) + else + set_active_to_power(game.proposal.from) game.state = "propose_subsidy_approve" }, } @@ -5687,15 +5699,6 @@ function may_cancel_subsidy() { return result } -function may_create_subsidy() { - if (is_two_player()) { - let major = coop_major_power(game.power) - if (major === P_PRAGMATIC || major === P_AUSTRIA) - return is_saxony_austrian_ally() - } - return true -} - function goto_cancel_subsidy() { game.proposal = { save_power: game.power, save_state: game.state, from: -1, to: -1 } game.state = "cancel_subsidy_from" -- cgit v1.2.3