From 669a33cc1fcb16e2bde395b2a3f0312f9142de40 Mon Sep 17 00:00:00 2001 From: SkyratBot <59378654+SkyratBot@users.noreply.github.com> Date: Fri, 14 Aug 2020 23:30:45 +0200 Subject: [PATCH] [MIRROR] fixes arnold pizza not checking for TRAIT_NODISMEMBER (#343) * fixes arnold pizza not checking for TRAIT_NODISMEMBER (#52771) Fixed Arnold pizza not checking for TRAIT_NODISMEMBER, resulting in a message being sent to the user even if they were fine after eating it. * fixes arnold pizza not checking for TRAIT_NODISMEMBER Co-authored-by: ShizCalev --- .../food_and_drinks/food/snacks_pizza.dm | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/code/modules/food_and_drinks/food/snacks_pizza.dm b/code/modules/food_and_drinks/food/snacks_pizza.dm index 11f9e5cf8ba..896fbbaee9c 100644 --- a/code/modules/food_and_drinks/food/snacks_pizza.dm +++ b/code/modules/food_and_drinks/food/snacks_pizza.dm @@ -178,17 +178,17 @@ tastes = list("crust" = 1, "tomato" = 1, "cheese" = 1, "pepperoni" = 2, "9 millimeter bullets" = 2) value = FOOD_ILLEGAL -/obj/item/reagent_containers/food/snacks/proc/try_break_off(mob/living/M, mob/living/user) //maybe i'll give you a pizza, maybe i'll break off your arm +/obj/item/reagent_containers/food/snacks/proc/try_break_off(mob/living/M, mob/living/user) //maybe i give you a pizza maybe i break off your arm + if(prob(50) || (M != user) || !iscarbon(user) || HAS_TRAIT(user, TRAIT_NODISMEMBER)) + return var/obj/item/bodypart/l_arm = user.get_bodypart(BODY_ZONE_L_ARM) var/obj/item/bodypart/r_arm = user.get_bodypart(BODY_ZONE_R_ARM) - if(prob(50) && iscarbon(user) && M == user && (r_arm || l_arm)) - to_chat(user, "Maybe I'll give you a pizza, maybe I'll break off your arm.") //makes the reference more obvious - user.visible_message("\The [src] breaks off [user]'s arm!", "\The [src] breaks off your arm!") - if(l_arm) - l_arm.dismember() - else - r_arm.dismember() - playsound(user, "desecration" ,50, TRUE, -1) + var/did_the_thing = (l_arm?.dismember() || r_arm?.dismember()) //not all limbs can be removed, so important to check that we did. the. thing. + if(!did_the_thing) + return + to_chat(user, "Maybe I'll give you a pizza, maybe I'll break off your arm.") //makes the reference more obvious + user.visible_message("\The [src] breaks off [user]'s arm!", "\The [src] breaks off your arm!") + playsound(user, "desecration", 50, TRUE, -1) /obj/item/reagent_containers/food/snacks/proc/i_kill_you(obj/item/I, mob/user) if(istype(I, /obj/item/reagent_containers/food/snacks/pineappleslice))