From 7f60f74c4026e04ec303a793015b5805e38eb900 Mon Sep 17 00:00:00 2001 From: Mischa Untaga <99098079+MischaU8@users.noreply.github.com> Date: Tue, 17 Oct 2023 11:09:16 +0200 Subject: prevent PSL from going below 0 --- rules.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/rules.js b/rules.js index 70cbe65..17c3074 100644 --- a/rules.js +++ b/rules.js @@ -143,9 +143,9 @@ function raise_fln_psl(amount) { log(`>FLN PSL +${amount}`) if (game.fln_psl > MAX_PSL) { let excess_psl = game.fln_psl - MAX_PSL - log(`FLN PSL exceeds ${MAX_PSL}; Goverment ${-excess_psl} PSL`) + log(`FLN PSL exceeds ${MAX_PSL}`) game.fln_psl = MAX_PSL - game.gov_psl -= excess_psl + lower_gov_psl(excess_psl) } } @@ -155,9 +155,9 @@ function raise_gov_psl(amount) { log(`>Goverment PSL +${amount}`) if (game.gov_psl > MAX_PSL) { let excess_psl = game.gov_psl - MAX_PSL - log(`Government PSL exceeds ${MAX_PSL}; FLN ${-excess_psl} PSL`) + log(`Government PSL exceeds ${MAX_PSL}`) game.gov_psl = MAX_PSL - game.fln_psl -= excess_psl + lower_fln_psl(excess_psl) } } -- cgit v1.2.3