From a651b629c940f9be11bd5ecd108960caf8d21b61 Mon Sep 17 00:00:00 2001 From: Putnam Date: Sun, 7 Mar 2021 19:28:50 -0800 Subject: [PATCH] Allows repeated mode adjust to be >100 total --- code/controllers/configuration/configuration.dm | 4 ++-- code/game/gamemodes/dynamic/dynamic_rulesets.dm | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/code/controllers/configuration/configuration.dm b/code/controllers/configuration/configuration.dm index 9d5110daf5..53fbd15651 100644 --- a/code/controllers/configuration/configuration.dm +++ b/code/controllers/configuration/configuration.dm @@ -415,7 +415,7 @@ Example config: while(recent_round) adjustment += repeated_mode_adjust[recent_round] recent_round = SSpersistence.saved_modes.Find(name,recent_round+1,0) - probability *= ((100-adjustment)/100) + probability *= max(0,((100-adjustment)/100)) runnable_storytellers[S] = probability return runnable_storytellers @@ -448,7 +448,7 @@ Example config: while(recent_round) adjustment += repeated_mode_adjust[recent_round] recent_round = SSpersistence.saved_modes.Find(M.config_tag,recent_round+1,0) - final_weight *= ((100-adjustment)/100) + final_weight *= max(0,((100-adjustment)/100)) runnable_modes[M] = final_weight return runnable_modes diff --git a/code/game/gamemodes/dynamic/dynamic_rulesets.dm b/code/game/gamemodes/dynamic/dynamic_rulesets.dm index 3e7e504130..f1e48eb31c 100644 --- a/code/game/gamemodes/dynamic/dynamic_rulesets.dm +++ b/code/game/gamemodes/dynamic/dynamic_rulesets.dm @@ -106,6 +106,7 @@ for(var/i in 1 to 3) if(config_tag in saved_dynamic_rules[i]) weight_mult -= (repeated_mode_adjust[i]/100) + weight_mult = max(0,weight_mult) if(config_tag in costs) cost = costs[config_tag] if(config_tag in requirementses)