From 1ea4e0e14687e25d89a01830f172ea662259e5ba Mon Sep 17 00:00:00 2001 From: Verkister Date: Mon, 22 Nov 2021 20:00:35 +0200 Subject: [PATCH] Little tweaks to holder noms Moves the part of the code handling the holder handling on scooped up snacking to where the actual snacking happens, and also clears and deletes the holder afterward. Also contains checks to make sure any undeclared stowaways in holder contents also get eaten (or dumped on the ground if that somehow fails) instead of getting deleted with the holder. Probably fixes a garbage collection jank bug that sometimes makes the holder dump the prey back on ground after they've already been eaten, and also fixes the thing with the holder item still lingering in hand for the entire life tick duration after the prey has already been eaten. --- code/modules/vore/eating/living_vr.dm | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/code/modules/vore/eating/living_vr.dm b/code/modules/vore/eating/living_vr.dm index 23dd3eea553..593b344da7b 100644 --- a/code/modules/vore/eating/living_vr.dm +++ b/code/modules/vore/eating/living_vr.dm @@ -143,9 +143,7 @@ if(is_vore_predator(src)) for(var/mob/living/M in H.contents) if(attacker.eat_held_mob(attacker, M, src)) - if(H.held_mob == M) - H.held_mob = null - return TRUE //return TRUE to exit upper procs + return TRUE //return TRUE to exit upper procs else log_debug("[attacker] attempted to feed [H.contents] to [src] ([type]) but it failed.") @@ -518,7 +516,16 @@ user.visible_message(success_msg) // Actually shove prey into the belly. - belly.nom_mob(prey, user) + if(istype(prey.loc, /obj/item/weapon/holder)) + var/obj/item/weapon/holder/H = prey.loc + for(var/mob/living/M in H.contents) + belly.nom_mob(M, user) + if(M.loc == H) // In case nom_mob failed somehow. + M.forceMove(get_turf(src)) + H.held_mob = null + qdel(H) + else + belly.nom_mob(prey, user) if(!ishuman(user)) user.update_icons()