[MIRROR] fixes transformation code runtiming (maybe fixes monkey fever???) (#5215)

* fixes transformation code runtiming (maybe fixes monkey fever???) (#58642)

transformation code didnt check if the lists with strings had anything in them, causing a runtime from pick()

* fixes transformation code runtiming (maybe fixes monkey fever???)

Co-authored-by: Fikou <piotrbryla@onet.pl>
This commit is contained in:
SkyratBot
2021-04-26 12:01:14 +01:00
committed by GitHub
co-authored by Fikou
parent 4b6e542752
commit 2a36b0851c
+5 -5
View File
@@ -37,16 +37,16 @@
switch(stage)
if(1)
if (stage1 && DT_PROB(stage_prob, delta_time))
if (length(stage1) && DT_PROB(stage_prob, delta_time))
to_chat(affected_mob, pick(stage1))
if(2)
if (stage2 && DT_PROB(stage_prob, delta_time))
if (length(stage2) && DT_PROB(stage_prob, delta_time))
to_chat(affected_mob, pick(stage2))
if(3)
if (stage3 && DT_PROB(stage_prob * 2, delta_time))
if (length(stage3) && DT_PROB(stage_prob * 2, delta_time))
to_chat(affected_mob, pick(stage3))
if(4)
if (stage4 && DT_PROB(stage_prob * 2, delta_time))
if (length(stage4) && DT_PROB(stage_prob * 2, delta_time))
to_chat(affected_mob, pick(stage4))
if(5)
do_disease_transformation(affected_mob)
@@ -54,7 +54,7 @@
/datum/disease/transformation/proc/do_disease_transformation(mob/living/affected_mob)
if(istype(affected_mob, /mob/living/carbon) && affected_mob.stat != DEAD)
if(stage5)
if(length(stage5))
to_chat(affected_mob, pick(stage5))
if(QDELETED(affected_mob))
return