From 0aa94432072344be6056706098aa0bface1ed5fc Mon Sep 17 00:00:00 2001 From: NovaBot <154629622+NovaBot13@users.noreply.github.com> Date: Tue, 27 Feb 2024 23:41:09 -0500 Subject: [PATCH] [MIRROR] Fix rat heart (#1184) * Fix rat heart (#81698) ## About The Pull Request Fixes #81696 `on_mob_insert` doesn't return a truthy value from parent call, it returns null / nothing Also patches a potential exploit involving that can mutate check ## Changelog :cl: Melbert fix: Rat hearts apply their damage modifier malus correctly /:cl: * Fix rat heart --------- Co-authored-by: MrMelbert <51863163+MrMelbert@users.noreply.github.com> --- .../dna_infuser/organ_sets/rat_organs.dm | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/code/game/machinery/dna_infuser/organ_sets/rat_organs.dm b/code/game/machinery/dna_infuser/organ_sets/rat_organs.dm index 092a4c7889a..4e84870ec9c 100644 --- a/code/game/machinery/dna_infuser/organ_sets/rat_organs.dm +++ b/code/game/machinery/dna_infuser/organ_sets/rat_organs.dm @@ -65,26 +65,22 @@ /obj/item/organ/internal/heart/rat/on_mob_insert(mob/living/carbon/receiver) . = ..() - if(!. || !ishuman(receiver)) + if(!ishuman(receiver)) return var/mob/living/carbon/human/human_receiver = receiver - if(!human_receiver.can_mutate()) - return - human_receiver.dna.add_mutation(/datum/mutation/human/dwarfism) + if(human_receiver.can_mutate()) + human_receiver.dna.add_mutation(/datum/mutation/human/dwarfism) //but 1.5 damage - if(human_receiver.physiology) - human_receiver.physiology.damage_resistance -= 50 + human_receiver.physiology?.damage_resistance -= 50 /obj/item/organ/internal/heart/rat/on_mob_remove(mob/living/carbon/heartless, special) . = ..() if(!ishuman(heartless)) return var/mob/living/carbon/human/human_heartless = heartless - if(!human_heartless.can_mutate()) - return - human_heartless.dna.remove_mutation(/datum/mutation/human/dwarfism) - if(human_heartless.physiology) - human_heartless.physiology.damage_resistance += 50 + if(human_heartless.can_mutate()) + human_heartless.dna.remove_mutation(/datum/mutation/human/dwarfism) + human_heartless.physiology?.damage_resistance += 50 /// you occasionally squeak, and have some rat related verbal tics /obj/item/organ/internal/tongue/rat