From 6f97d3e2eae775b7c192853a61f5e6ba72b6cb4a Mon Sep 17 00:00:00 2001 From: carlarctg <53100513+carlarctg@users.noreply.github.com> Date: Sun, 10 Nov 2024 19:45:26 -0300 Subject: [PATCH] fixes some rand() loops (#87795) ## About The Pull Request i in rand(x,y) doesnt work i in 1 to rand(x,y) does ## Why It's Good For The Game bugggs ghommie stole my gbp ## Changelog :cl: fix: fixed random dm modifiers & some life-like reagent reactions /:cl: --- code/modules/deathmatch/deathmatch_modifier.dm | 2 +- code/modules/reagents/chemistry/recipes/others.dm | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/code/modules/deathmatch/deathmatch_modifier.dm b/code/modules/deathmatch/deathmatch_modifier.dm index 9faafa91a48..9671f19c92a 100644 --- a/code/modules/deathmatch/deathmatch_modifier.dm +++ b/code/modules/deathmatch/deathmatch_modifier.dm @@ -519,7 +519,7 @@ modifiers_pool -= modpath ///Pick global modifiers at random. - for(var/iteration in rand(3, 5)) + for(var/iteration in 1 to rand(3, 5)) var/datum/deathmatch_modifier/modifier = GLOB.deathmatch_game.modifiers[pick_n_take(modifiers_pool)] modifier.on_select(lobby) modifier.on_start_game(lobby) diff --git a/code/modules/reagents/chemistry/recipes/others.dm b/code/modules/reagents/chemistry/recipes/others.dm index 8e86a85e212..542850ac9be 100644 --- a/code/modules/reagents/chemistry/recipes/others.dm +++ b/code/modules/reagents/chemistry/recipes/others.dm @@ -571,7 +571,7 @@ /datum/chemical_reaction/corgium/on_reaction(datum/reagents/holder, datum/equilibrium/reaction, created_volume) var/location = get_turf(holder.my_atom) - for(var/i in rand(1, created_volume) to created_volume) // More lulz. + for(var/i in 1 to rand(1, created_volume)) // More lulz. new /mob/living/basic/pet/dog/corgi(location) ..() @@ -627,7 +627,7 @@ /datum/chemical_reaction/butterflium/on_reaction(datum/reagents/holder, datum/equilibrium/reaction, created_volume) var/location = get_turf(holder.my_atom) - for(var/i in rand(1, created_volume) to created_volume) + for(var/i in 1 to rand(1, created_volume)) new /mob/living/basic/butterfly(location) ..() //scream powder @@ -976,7 +976,7 @@ /datum/chemical_reaction/ant_slurry/on_reaction(datum/reagents/holder, datum/equilibrium/reaction, created_volume) var/location = get_turf(holder.my_atom) - for(var/i in rand(1, created_volume) to created_volume) + for(var/i in 1 to rand(1, created_volume)) new /mob/living/basic/ant(location) ..()