From 2dc01dc75e85e4723667819d8575cc08157ed3ee Mon Sep 17 00:00:00 2001 From: Mischa Untaga <99098079+MischaU8@users.noreply.github.com> Date: Thu, 19 Oct 2023 11:23:15 +0200 Subject: fix: Distribute PSL could lead to FLN PSL overflow --- rules.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/rules.js b/rules.js index 26ed085..7a1c598 100644 --- a/rules.js +++ b/rules.js @@ -2951,12 +2951,19 @@ function goto_distribute_psp(who, psp, reason) { function distribute_psl(where, delta) { push_undo() - log(`>${player_name(where)} PSL ${add_sign(delta)}`) if (where === FLN) { - game.fln_psl += delta + if (delta > 0) { + raise_fln_psl(delta) + } else { + lower_fln_psl(-delta) + } } else { - game.gov_psl += delta + if (delta > 0) { + raise_gov_psl(delta) + } else { + lower_gov_psl(-delta) + } } game.distribute.psp -= Math.abs(delta) if (check_victory()) -- cgit v1.2.3