diff options
author | Mischa Untaga <99098079+MischaU8@users.noreply.github.com> | 2023-10-17 11:09:16 +0200 |
---|---|---|
committer | Mischa Untaga <99098079+MischaU8@users.noreply.github.com> | 2023-10-17 11:09:16 +0200 |
commit | 7f60f74c4026e04ec303a793015b5805e38eb900 (patch) | |
tree | 389129c4e459e5e1d38a6ab65dabf95b6f188968 | |
parent | feac28f95c1ec7b1f0cb3aa821a8f78a153119ab (diff) | |
download | algeria-7f60f74c4026e04ec303a793015b5805e38eb900.tar.gz |
prevent PSL from going below 0
-rw-r--r-- | rules.js | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -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) } } |