Merge pull request #11475 from MrStonedOne/patch-33

Changes gold slimes mob list to use initial() and only generate the mob list once.
This commit is contained in:
Razharas
2015-09-01 09:54:31 +03:00
+12 -12
View File
@@ -21,18 +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))
var/mob/living/simple_animal/M = new T
switch(M.gold_core_spawnable)
if(1)
meancritters += M.type
if(2)
nicecritters += M.type
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)
@@ -54,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)