From bc38ec63e9cbe65fc8039f0135931a786f3f9d7e Mon Sep 17 00:00:00 2001 From: SkyratBot <59378654+SkyratBot@users.noreply.github.com> Date: Sat, 18 Mar 2023 03:35:04 +0100 Subject: [PATCH] [MIRROR] Cleans up `..()` usage in organs' `Insert()` and `Remove()` [MDB IGNORE] (#19948) * Cleans up `..()` usage in organs' `Insert()` and `Remove()` (#74055) ## About The Pull Request fumbled around while investigating #74047 and turns out there's other organs that have the same issue as the reported alien organs in that issue. went around and replaced parent calls where applicable (cursed/demonic hearts, flashlight eyes, alien organs, abductor glands) ## Why It's Good For The Game Fixes #74047 Considerably less ghost internal organs, hopefully less unreported jank on removing organs ## Changelog :cl: fix: fixed a few internal organs acting wonky on inserting/removing (some xenomorph organs, abductor glands, flashlight eyes, demon/cursed hearts) /:cl: * Cleans up `..()` usage in organs' `Insert()` and `Remove()` --------- Co-authored-by: Sealed101 <75863639+Sealed101@users.noreply.github.com> --- code/game/objects/items/body_egg.dm | 4 ++-- code/modules/antagonists/abductor/equipment/gland.dm | 4 ++-- .../antagonists/abductor/equipment/glands/electric.dm | 4 ++-- .../antagonists/abductor/equipment/glands/slime.dm | 4 ++-- code/modules/mob/living/carbon/alien/organs.dm | 8 ++++---- .../mob/living/simple_animal/hostile/slaughter_demon.dm | 4 ++-- code/modules/surgery/organs/augments_arms.dm | 2 +- code/modules/surgery/organs/eyes.dm | 6 +++--- code/modules/surgery/organs/heart.dm | 6 +++--- 9 files changed, 21 insertions(+), 21 deletions(-) diff --git a/code/game/objects/items/body_egg.dm b/code/game/objects/items/body_egg.dm index 369c167698c..0f66ab45afc 100644 --- a/code/game/objects/items/body_egg.dm +++ b/code/game/objects/items/body_egg.dm @@ -16,7 +16,7 @@ Insert(loc) /obj/item/organ/internal/body_egg/Insert(mob/living/carbon/M, special = FALSE, drop_if_replaced = TRUE) - ..() + . = ..() ADD_TRAIT(owner, TRAIT_XENO_HOST, ORGAN_TRAIT) ADD_TRAIT(owner, TRAIT_XENO_IMMUNE, ORGAN_TRAIT) owner.med_hud_set_status() @@ -28,7 +28,7 @@ REMOVE_TRAIT(owner, TRAIT_XENO_IMMUNE, ORGAN_TRAIT) owner.med_hud_set_status() INVOKE_ASYNC(src, PROC_REF(RemoveInfectionImages), owner) - ..() + return ..() /obj/item/organ/internal/body_egg/on_death(delta_time, times_fired) . = ..() diff --git a/code/modules/antagonists/abductor/equipment/gland.dm b/code/modules/antagonists/abductor/equipment/gland.dm index 69f789e2b70..63a72824e41 100644 --- a/code/modules/antagonists/abductor/equipment/gland.dm +++ b/code/modules/antagonists/abductor/equipment/gland.dm @@ -89,10 +89,10 @@ var/datum/atom_hud/abductor/hud = GLOB.huds[DATA_HUD_ABDUCTOR] hud.remove_atom_from_hud(owner) clear_mind_control() - ..() + return ..() /obj/item/organ/internal/heart/gland/Insert(mob/living/carbon/M, special = FALSE, drop_if_replaced = TRUE) - ..() + . = ..() if(special != 2 && uses) // Special 2 means abductor surgery Start() var/datum/atom_hud/abductor/hud = GLOB.huds[DATA_HUD_ABDUCTOR] diff --git a/code/modules/antagonists/abductor/equipment/glands/electric.dm b/code/modules/antagonists/abductor/equipment/glands/electric.dm index 47eb8be7a13..f935b867143 100644 --- a/code/modules/antagonists/abductor/equipment/glands/electric.dm +++ b/code/modules/antagonists/abductor/equipment/glands/electric.dm @@ -8,12 +8,12 @@ mind_control_duration = 900 /obj/item/organ/internal/heart/gland/electric/Insert(mob/living/carbon/M, special = FALSE, drop_if_replaced = TRUE) - ..() + . = ..() ADD_TRAIT(owner, TRAIT_SHOCKIMMUNE, "abductor_gland") /obj/item/organ/internal/heart/gland/electric/Remove(mob/living/carbon/M, special = FALSE) REMOVE_TRAIT(owner, TRAIT_SHOCKIMMUNE, "abductor_gland") - ..() + return ..() /obj/item/organ/internal/heart/gland/electric/activate() owner.visible_message(span_danger("[owner]'s skin starts emitting electric arcs!"),\ diff --git a/code/modules/antagonists/abductor/equipment/glands/slime.dm b/code/modules/antagonists/abductor/equipment/glands/slime.dm index 676117cb3c5..ec99f4b4cc6 100644 --- a/code/modules/antagonists/abductor/equipment/glands/slime.dm +++ b/code/modules/antagonists/abductor/equipment/glands/slime.dm @@ -8,14 +8,14 @@ mind_control_duration = 2400 /obj/item/organ/internal/heart/gland/slime/Insert(mob/living/carbon/M, special = FALSE, drop_if_replaced = TRUE) - ..() + . = ..() owner.faction |= FACTION_SLIME owner.grant_language(/datum/language/slime, TRUE, TRUE, LANGUAGE_GLAND) /obj/item/organ/internal/heart/gland/slime/Remove(mob/living/carbon/M, special = FALSE) owner.faction -= FACTION_SLIME owner.remove_language(/datum/language/slime, TRUE, TRUE, LANGUAGE_GLAND) - ..() + return ..() /obj/item/organ/internal/heart/gland/slime/activate() to_chat(owner, span_warning("You feel nauseated!")) diff --git a/code/modules/mob/living/carbon/alien/organs.dm b/code/modules/mob/living/carbon/alien/organs.dm index aa0364b94ed..b91abbce0ec 100644 --- a/code/modules/mob/living/carbon/alien/organs.dm +++ b/code/modules/mob/living/carbon/alien/organs.dm @@ -68,14 +68,14 @@ owner.adjustPlasma(0.1 * plasma_rate * delta_time) /obj/item/organ/internal/alien/plasmavessel/Insert(mob/living/carbon/organ_owner, special = FALSE, drop_if_replaced = TRUE) - ..() + . = ..() if(isalien(organ_owner)) var/mob/living/carbon/alien/target_alien = organ_owner target_alien.updatePlasmaDisplay() RegisterSignal(organ_owner, COMSIG_MOB_GET_STATUS_TAB_ITEMS, PROC_REF(get_status_tab_item)) /obj/item/organ/internal/alien/plasmavessel/Remove(mob/living/carbon/organ_owner, special = FALSE) - ..() + . = ..() if(isalien(organ_owner)) var/mob/living/carbon/alien/organ_owner_alien = organ_owner organ_owner_alien.updatePlasmaDisplay() @@ -98,14 +98,14 @@ var/recent_queen_death = FALSE /obj/item/organ/internal/alien/hivenode/Insert(mob/living/carbon/organ_owner, special = FALSE, drop_if_replaced = TRUE) - ..() + . = ..() organ_owner.faction |= ROLE_ALIEN ADD_TRAIT(organ_owner, TRAIT_XENO_IMMUNE, ORGAN_TRAIT) /obj/item/organ/internal/alien/hivenode/Remove(mob/living/carbon/organ_owner, special = FALSE) organ_owner.faction -= ROLE_ALIEN REMOVE_TRAIT(organ_owner, TRAIT_XENO_IMMUNE, ORGAN_TRAIT) - ..() + return ..() //When the alien queen dies, all aliens suffer a penalty as punishment for failing to protect her. /obj/item/organ/internal/alien/hivenode/proc/queen_death() diff --git a/code/modules/mob/living/simple_animal/hostile/slaughter_demon.dm b/code/modules/mob/living/simple_animal/hostile/slaughter_demon.dm index af2811022ec..671fbf0ff10 100644 --- a/code/modules/mob/living/simple_animal/hostile/slaughter_demon.dm +++ b/code/modules/mob/living/simple_animal/hostile/slaughter_demon.dm @@ -181,13 +181,13 @@ src.Insert(user) //Consuming the heart literally replaces your heart with a demon heart. H A R D C O R E /obj/item/organ/internal/heart/demon/Insert(mob/living/carbon/M, special = FALSE, drop_if_replaced = TRUE) - ..() + . = ..() // Gives a non-eat-people crawl to the new owner var/datum/action/cooldown/spell/jaunt/bloodcrawl/crawl = new(M) crawl.Grant(M) /obj/item/organ/internal/heart/demon/Remove(mob/living/carbon/M, special = FALSE) - ..() + . = ..() var/datum/action/cooldown/spell/jaunt/bloodcrawl/crawl = locate() in M.actions qdel(crawl) diff --git a/code/modules/surgery/organs/augments_arms.dm b/code/modules/surgery/organs/augments_arms.dm index 56d21bc3a5a..4d329f09819 100644 --- a/code/modules/surgery/organs/augments_arms.dm +++ b/code/modules/surgery/organs/augments_arms.dm @@ -86,7 +86,7 @@ if(hand) UnregisterSignal(hand, COMSIG_ITEM_ATTACK_SELF) UnregisterSignal(arm_owner, COMSIG_KB_MOB_DROPITEM_DOWN) - ..() + return ..() /obj/item/organ/internal/cyberimp/arm/proc/on_item_attack_self() SIGNAL_HANDLER diff --git a/code/modules/surgery/organs/eyes.dm b/code/modules/surgery/organs/eyes.dm index 64361f1d954..d8e54cc4d5b 100644 --- a/code/modules/surgery/organs/eyes.dm +++ b/code/modules/surgery/organs/eyes.dm @@ -90,7 +90,7 @@ owner.dna?.species?.handle_body(affected_human) //updates eye icon /obj/item/organ/internal/eyes/Remove(mob/living/carbon/eye_owner, special = FALSE) - ..() + . = ..() if(ishuman(eye_owner)) var/mob/living/carbon/human/human_owner = eye_owner if(initial(eye_color_left)) @@ -345,7 +345,7 @@ return /obj/item/organ/internal/eyes/robotic/flashlight/Insert(mob/living/carbon/victim, special = FALSE, drop_if_replaced = FALSE) - ..() + . = ..() if(!eye) eye = new /obj/item/flashlight/eyelight() eye.on = TRUE @@ -359,7 +359,7 @@ eye.update_brightness(victim) eye.forceMove(src) victim.cure_blind(FLASHLIGHT_EYES) - ..() + return ..() // Welding shield implant /obj/item/organ/internal/eyes/robotic/shield diff --git a/code/modules/surgery/organs/heart.dm b/code/modules/surgery/organs/heart.dm index f79d79cb5b7..6ae5ba9998a 100644 --- a/code/modules/surgery/organs/heart.dm +++ b/code/modules/surgery/organs/heart.dm @@ -28,7 +28,7 @@ return ..() /obj/item/organ/internal/heart/Remove(mob/living/carbon/heartless, special = 0) - ..() + . = ..() if(!special) addtimer(CALLBACK(src, PROC_REF(stop_if_unowned)), 120) @@ -169,13 +169,13 @@ add_colour = FALSE /obj/item/organ/internal/heart/cursed/Insert(mob/living/carbon/accursed, special = FALSE, drop_if_replaced = TRUE) - ..() + . = ..() last_pump = world.time // give them time to react if(owner) to_chat(owner, span_userdanger("Your heart has been replaced with a cursed one, you have to pump this one manually otherwise you'll die!")) /obj/item/organ/internal/heart/cursed/Remove(mob/living/carbon/accursed, special = FALSE) - ..() + . = ..() accursed.remove_client_colour(/datum/client_colour/cursed_heart_blood) /datum/action/item_action/organ_action/cursed_heart