diff options
author | Tor Andersson <tor@ccxvii.net> | 2024-11-02 10:24:24 +0100 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2024-11-02 10:24:24 +0100 |
commit | 322a3e9f6e0985b1b180bc4bec5db2b1ae05d52e (patch) | |
tree | 615f6944ecc4e7b453028b7bff67548202be6003 /rules.js | |
parent | 16be02c06cbad26e3f8db3d9da4ad1774a5475b9 (diff) | |
download | maria-322a3e9f6e0985b1b180bc4bec5db2b1ae05d52e.tar.gz |
fix who approves subsidy contract
Diffstat (limited to 'rules.js')
-rw-r--r-- | rules.js | 23 |
1 files changed, 13 insertions, 10 deletions
@@ -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" |