summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMischa Untaga <99098079+MischaU8@users.noreply.github.com>2023-10-19 11:23:15 +0200
committerMischa Untaga <99098079+MischaU8@users.noreply.github.com>2023-10-19 11:36:09 +0200
commit2dc01dc75e85e4723667819d8575cc08157ed3ee (patch)
tree5d0acff128183a5dfffe9b37606f051c8db86a0c
parent932b85f9c0da6e0eb5f5953d243ea67e5c0a2008 (diff)
downloadalgeria-2dc01dc75e85e4723667819d8575cc08157ed3ee.tar.gz
fix: Distribute PSL could lead to FLN PSL overflow
-rw-r--r--rules.js13
1 files 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())