From 72dfc6a21cfbb6904d671ab51da10981a4784d6f Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Thu, 24 Oct 2024 12:28:28 +0200 Subject: cancel contracts when saxony defects --- rules.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/rules.js b/rules.js index 94db101..8ebf3cc 100644 --- a/rules.js +++ b/rules.js @@ -4328,6 +4328,10 @@ function goto_saxony_becomes_neutral() { log_br() log("Saxony becomes neutral!") + // invalidate contracts with former allies + map_delete(game.contracts[P_FRANCE], P_SAXONY) + map_delete(game.contracts[P_PRUSSIA], P_SAXONY) + // Return all victory markers log(">Removed victory markers") for (let s of all_home_country_fortresses[P_SAXONY]) { @@ -4429,6 +4433,10 @@ function goto_saxony_becomes_austrian_ally() { log_br() log("Saxony becomes Austrian ally!") + // invalidate contracts with former allies + map_delete(game.contracts[P_FRANCE], P_SAXONY) + map_delete(game.contracts[P_PRUSSIA], P_SAXONY) + game.selected = SAXONY_GENERAL if (game.pos[SAXONY_GENERAL] === ELIMINATED) { -- cgit v1.2.3