diff --git a/code/modules/reagents/Chemistry-Recipes.dm b/code/modules/reagents/Chemistry-Recipes.dm index 112b73a1e7f..84822634782 100644 --- a/code/modules/reagents/Chemistry-Recipes.dm +++ b/code/modules/reagents/Chemistry-Recipes.dm @@ -21,17 +21,18 @@ return //I recommend you set the result amount to the total volume of all components. - +var/list/chemical_mob_spawn_meancritters = list() // list of possible hostile mobs +var/list/chemical_mob_spawn_nicecritters = list() // and possible friendly mobs /datum/chemical_reaction/proc/chemical_mob_spawn(datum/reagents/holder, amount_to_spawn, reaction_name, mob_faction = "chemicalsummon") if(holder && holder.my_atom) - var/list/meancritters = list() // list of possible hostile mobs - var/list/nicecritters = list() // and possible friendly mobs - for(var/T in typesof(/mob/living/simple_animal)) - switch(initial(T:gold_core_spawnable)) - if(1) - meancritters += T - if(2) - nicecritters += T + if (chemical_mob_spawn_meancritters.len <= 0 || chemical_mob_spawn_nicecritters.len <= 0) + for (var/T in typesof(/mob/living/simple_animal)) + var/mob/living/simple_animal/SA = T + switch(initial(SA.gold_core_spawnable)) + if(1) + chemical_mob_spawn_meancritters += T + if(2) + chemical_mob_spawn_nicecritters += T var/atom/A = holder.my_atom var/turf/T = get_turf(A) var/area/my_area = get_area(T) @@ -53,9 +54,9 @@ for(var/i = 1, i <= amount_to_spawn, i++) var/chosen if (reaction_name == "Friendly Gold Slime") - chosen = pick(nicecritters) + chosen = pick(chemical_mob_spawn_nicecritters) else - chosen = pick(meancritters) + chosen = pick(chemical_mob_spawn_meancritters) var/mob/living/simple_animal/C = new chosen C.faction |= mob_faction C.loc = get_turf(holder.my_atom)