From 438b46cc171e1e86cd94976b76a27d9cddf2031e Mon Sep 17 00:00:00 2001 From: oranges Date: Wed, 14 Sep 2016 23:32:01 +0000 Subject: [PATCH 1/2] Prevent infinite loops with DROPDEL items We unset the flag just before calling qdel, preventing infinite loops where the objects Destroy calls dropped, which is the case for a number of items --- code/game/objects/items.dm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/code/game/objects/items.dm b/code/game/objects/items.dm index 9d7659791ce..1e0b83f6ffd 100644 --- a/code/game/objects/items.dm +++ b/code/game/objects/items.dm @@ -344,6 +344,8 @@ var/global/image/fire_overlay = image("icon" = 'icons/effects/fire.dmi', "icon_s var/datum/action/A = X A.Remove(user) if(DROPDEL & flags) + //Prevents infinite loops where Destroy() calls an objects dropped() function + flags &= ~DROPDEL qdel(src) // called just as an item is picked up (loc is not yet changed) @@ -589,4 +591,4 @@ obj/item/proc/item_action_slot_check(slot, mob/user) //when an item modify our speech spans when in our active hand. Override this to modify speech spans. /obj/item/proc/get_held_item_speechspans(mob/living/carbon/user) - return \ No newline at end of file + return From 10d4ce619f346dac2fdbdae4ea58a8cbf71a3bd5 Mon Sep 17 00:00:00 2001 From: oranges Date: Thu, 15 Sep 2016 02:08:40 +0000 Subject: [PATCH 2/2] Prevent loops with del_on_death var for simple mobs Same principle as the fix for DROPDEL --- code/modules/mob/living/simple_animal/simple_animal.dm | 3 +++ 1 file changed, 3 insertions(+) diff --git a/code/modules/mob/living/simple_animal/simple_animal.dm b/code/modules/mob/living/simple_animal/simple_animal.dm index edca0beac1d..7afc1fa3132 100644 --- a/code/modules/mob/living/simple_animal/simple_animal.dm +++ b/code/modules/mob/living/simple_animal/simple_animal.dm @@ -301,6 +301,9 @@ if(del_on_death) ghostize() stat = DEAD + //Prevent infinite loops if the mob Destroy() is overriden in such + //a manner as to cause a call to death() again + del_on_death = FALSE qdel(src) else health = 0