From 8de11845d5be76bf92bcee20db9b2f925d6e5839 Mon Sep 17 00:00:00 2001 From: Ghommie <42542238+Ghommie@users.noreply.github.com> Date: Sun, 2 Feb 2020 03:39:49 +0100 Subject: [PATCH] Removing a troublesome argument from organ/Remove() in favor or using the 'owner' variable --- .../diseases/advance/symptoms/vision.dm | 2 +- code/game/machinery/cloning.dm | 4 +-- code/game/objects/items/airlock_painter.dm | 2 +- code/game/objects/items/body_egg.dm | 6 ++-- .../objects/items/devices/compressionkit.dm | 2 +- code/modules/admin/verbs/manipulate_organs.dm | 2 +- .../abductor/equipment/abduction_surgery.dm | 2 +- .../antagonists/abductor/equipment/gland.dm | 9 ++--- .../abductor/equipment/glands/access.dm | 7 ++-- .../abductor/equipment/glands/electric.dm | 7 ++-- .../abductor/equipment/glands/heal.dm | 8 ++--- .../antagonists/changeling/powers/headcrab.dm | 2 +- .../antagonists/changeling/powers/panacea.dm | 2 +- .../clockcult/clock_items/soul_vessel.dm | 2 +- .../antagonists/slaughter/slaughter.dm | 7 ++-- code/modules/cargo/supplypod.dm | 2 +- .../mining/equipment/regenerative_core.dm | 4 +-- code/modules/mob/living/brain/brain_item.dm | 10 +++--- .../modules/mob/living/carbon/alien/organs.dm | 22 ++++++------ code/modules/mob/living/carbon/carbon.dm | 4 +-- code/modules/mob/living/carbon/death.dm | 4 +-- .../mob/living/carbon/human/species.dm | 24 ++++++------- .../carbon/human/species_types/felinid.dm | 2 +- .../human/species_types/shadowpeople.dm | 18 +++++----- .../simple_animal/hostile/cat_butcher.dm | 2 +- .../living/simple_animal/hostile/headcrab.dm | 2 +- code/modules/mob/transform_procs.dm | 8 ++--- code/modules/power/supermatter/supermatter.dm | 2 +- code/modules/power/tesla/energy_ball.dm | 2 +- code/modules/projectiles/guns/ballistic.dm | 2 +- .../chemistry/reagents/alcohol_reagents.dm | 2 +- code/modules/spells/spell_types/lichdom.dm | 2 +- code/modules/spells/spell_types/summonitem.dm | 2 +- .../surgery/bodyparts/dismemberment.dm | 6 ++-- code/modules/surgery/nutcracker.dm | 2 +- code/modules/surgery/organ_manipulation.dm | 2 +- code/modules/surgery/organs/appendix.dm | 9 ++--- code/modules/surgery/organs/augments_arms.dm | 2 +- code/modules/surgery/organs/augments_chest.dm | 15 ++++---- code/modules/surgery/organs/augments_eyes.dm | 8 ++--- .../surgery/organs/augments_internal.dm | 4 +-- code/modules/surgery/organs/ears.dm | 7 ++-- code/modules/surgery/organs/eyes.dm | 35 ++++++++++--------- code/modules/surgery/organs/heart.dm | 12 +++---- code/modules/surgery/organs/liver.dm | 12 +++---- code/modules/surgery/organs/organ_internal.dm | 29 ++++++++------- code/modules/surgery/organs/stomach.dm | 4 +-- code/modules/surgery/organs/tails.dm | 22 ++++++------ code/modules/surgery/organs/tongue.dm | 13 +++---- code/modules/zombie/organs.dm | 15 ++++---- .../code/modules/arousal/genitals.dm | 9 ++--- .../reagents/chemistry/reagents/MKUltra.dm | 2 +- .../reagents/chemistry/reagents/SDGF.dm | 2 +- .../chemistry/reagents/fermi_reagents.dm | 4 +-- .../reagents/chemistry/reagents/healing.dm | 4 +-- 55 files changed, 203 insertions(+), 193 deletions(-) diff --git a/code/datums/diseases/advance/symptoms/vision.dm b/code/datums/diseases/advance/symptoms/vision.dm index b4a33cb837..4eacf27338 100644 --- a/code/datums/diseases/advance/symptoms/vision.dm +++ b/code/datums/diseases/advance/symptoms/vision.dm @@ -66,7 +66,7 @@ Bonus eyes.applyOrganDamage(eyes.maxHealth) else M.visible_message("[M]'s eyes fall off their sockets!", "Your eyes fall off their sockets!") - eyes.Remove(M) + eyes.Remove() eyes.forceMove(get_turf(M)) else to_chat(M, "Your eyes burn horrifically!") diff --git a/code/game/machinery/cloning.dm b/code/game/machinery/cloning.dm index afb882598e..62304112b2 100644 --- a/code/game/machinery/cloning.dm +++ b/code/game/machinery/cloning.dm @@ -61,7 +61,7 @@ QDEL_LIST(unattached_flesh) . = ..() -/obj/machinery/clonepod/RefreshParts() +/obj/machinery/clonepod/RefreshParts() speed_coeff = 0 efficiency = 0 for(var/obj/item/stock_parts/scanning_module/S in component_parts) @@ -471,7 +471,7 @@ if(!istype(organ) || (organ.organ_flags & ORGAN_VITAL)) continue organ.organ_flags |= ORGAN_FROZEN - organ.Remove(H, special=TRUE) + organ.Remove(TRUE) organ.forceMove(src) unattached_flesh += organ diff --git a/code/game/objects/items/airlock_painter.dm b/code/game/objects/items/airlock_painter.dm index 75a2ad3b74..e63474dd6f 100644 --- a/code/game/objects/items/airlock_painter.dm +++ b/code/game/objects/items/airlock_painter.dm @@ -64,7 +64,7 @@ if(!L) return OXYLOSS - L.Remove(user) + L.Remove() // make some colorful reagent, and apply it to the lungs L.create_reagents(10) diff --git a/code/game/objects/items/body_egg.dm b/code/game/objects/items/body_egg.dm index 59a5c50bf6..a311644b04 100644 --- a/code/game/objects/items/body_egg.dm +++ b/code/game/objects/items/body_egg.dm @@ -20,12 +20,12 @@ owner.med_hud_set_status() INVOKE_ASYNC(src, .proc/AddInfectionImages, owner) -/obj/item/organ/body_egg/Remove(var/mob/living/carbon/M, special = 0) - if(owner) +/obj/item/organ/body_egg/Remove(special = FALSE) + if(!QDELETED(owner)) REMOVE_TRAIT(owner, TRAIT_XENO_HOST, TRAIT_GENERIC) owner.med_hud_set_status() INVOKE_ASYNC(src, .proc/RemoveInfectionImages, owner) - ..() + return ..() /obj/item/organ/body_egg/on_death() . = ..() diff --git a/code/game/objects/items/devices/compressionkit.dm b/code/game/objects/items/devices/compressionkit.dm index 6e62c389c7..eebe4dc69b 100644 --- a/code/game/objects/items/devices/compressionkit.dm +++ b/code/game/objects/items/devices/compressionkit.dm @@ -46,7 +46,7 @@ var/list/organs = M.getorganszone("head") + M.getorganszone("eyes") + M.getorganszone("mouth") for(var/internal_organ in organs) var/obj/item/organ/I = internal_organ - I.Remove(M) + I.Remove() I.forceMove(T) head.drop_limb() qdel(head) diff --git a/code/modules/admin/verbs/manipulate_organs.dm b/code/modules/admin/verbs/manipulate_organs.dm index a3b7e4247c..b2648735ec 100644 --- a/code/modules/admin/verbs/manipulate_organs.dm +++ b/code/modules/admin/verbs/manipulate_organs.dm @@ -58,7 +58,7 @@ if(isorgan(organ)) O = organ - O.Remove(C) + O.Remove() else I = organ I.removed(C) diff --git a/code/modules/antagonists/abductor/equipment/abduction_surgery.dm b/code/modules/antagonists/abductor/equipment/abduction_surgery.dm index 98164de099..971051588e 100644 --- a/code/modules/antagonists/abductor/equipment/abduction_surgery.dm +++ b/code/modules/antagonists/abductor/equipment/abduction_surgery.dm @@ -33,7 +33,7 @@ if(IC) user.visible_message("[user] pulls [IC] out of [target]'s [target_zone]!", "You pull [IC] out of [target]'s [target_zone].") user.put_in_hands(IC) - IC.Remove(target) + IC.Remove() return 1 else to_chat(user, "You don't find anything in [target]'s [target_zone]!") diff --git a/code/modules/antagonists/abductor/equipment/gland.dm b/code/modules/antagonists/abductor/equipment/gland.dm index 82170444d0..0d30ebe992 100644 --- a/code/modules/antagonists/abductor/equipment/gland.dm +++ b/code/modules/antagonists/abductor/equipment/gland.dm @@ -73,13 +73,14 @@ active_mind_control = FALSE return TRUE -/obj/item/organ/heart/gland/Remove(mob/living/carbon/M, special = 0) +/obj/item/organ/heart/gland/Remove(special = FALSE) active = 0 if(initial(uses) == 1) uses = initial(uses) - var/datum/atom_hud/abductor/hud = GLOB.huds[DATA_HUD_ABDUCTOR] - hud.remove_from_hud(owner) - clear_mind_control() + if(!QDELETED(owner)) + var/datum/atom_hud/abductor/hud = GLOB.huds[DATA_HUD_ABDUCTOR] + hud.remove_from_hud(owner) + clear_mind_control() ..() /obj/item/organ/heart/gland/Insert(mob/living/carbon/M, special = 0, drop_if_replaced = TRUE) diff --git a/code/modules/antagonists/abductor/equipment/glands/access.dm b/code/modules/antagonists/abductor/equipment/glands/access.dm index 548650d4e3..c795233dc9 100644 --- a/code/modules/antagonists/abductor/equipment/glands/access.dm +++ b/code/modules/antagonists/abductor/equipment/glands/access.dm @@ -14,6 +14,7 @@ /obj/item/organ/heart/gland/access/proc/free_access(datum/source, obj/O) return TRUE -/obj/item/organ/heart/gland/access/Remove(mob/living/carbon/M, special = 0) - UnregisterSignal(owner, COMSIG_MOB_ALLOWED) - ..() \ No newline at end of file +/obj/item/organ/heart/gland/access/Remove(special = FALSE) + if(!QDELETED(owner)) + UnregisterSignal(owner, COMSIG_MOB_ALLOWED) + return ..() \ No newline at end of file diff --git a/code/modules/antagonists/abductor/equipment/glands/electric.dm b/code/modules/antagonists/abductor/equipment/glands/electric.dm index 63d95f8b1f..82ee77d192 100644 --- a/code/modules/antagonists/abductor/equipment/glands/electric.dm +++ b/code/modules/antagonists/abductor/equipment/glands/electric.dm @@ -11,9 +11,10 @@ ..() ADD_TRAIT(owner, TRAIT_SHOCKIMMUNE, "abductor_gland") -/obj/item/organ/heart/gland/electric/Remove(mob/living/carbon/M, special = 0) - REMOVE_TRAIT(owner, TRAIT_SHOCKIMMUNE, "abductor_gland") - ..() +/obj/item/organ/heart/gland/electric/Remove(special = FALSE) + if(!QDELETED(owner)) + REMOVE_TRAIT(owner, TRAIT_SHOCKIMMUNE, "abductor_gland") + return ..() /obj/item/organ/heart/gland/electric/activate() owner.visible_message("[owner]'s skin starts emitting electric arcs!",\ diff --git a/code/modules/antagonists/abductor/equipment/glands/heal.dm b/code/modules/antagonists/abductor/equipment/glands/heal.dm index bf9a00e13c..c60ec90480 100644 --- a/code/modules/antagonists/abductor/equipment/glands/heal.dm +++ b/code/modules/antagonists/abductor/equipment/glands/heal.dm @@ -65,14 +65,14 @@ /obj/item/organ/heart/gland/heal/proc/reject_implant(obj/item/organ/cyberimp/implant) owner.visible_message("[owner] vomits up his [implant.name]!", "You suddenly vomit up your [implant.name]!") owner.vomit(0, TRUE, TRUE, 1, FALSE, FALSE, FALSE, TRUE) - implant.Remove(owner) + implant.Remove() implant.forceMove(owner.drop_location()) /obj/item/organ/heart/gland/heal/proc/replace_liver(obj/item/organ/liver/liver) if(liver) owner.visible_message("[owner] vomits up his [liver.name]!", "You suddenly vomit up your [liver.name]!") owner.vomit(0, TRUE, TRUE, 1, FALSE, FALSE, FALSE, TRUE) - liver.Remove(owner) + liver.Remove() liver.forceMove(owner.drop_location()) else to_chat(owner, "You feel a weird rumble in your bowels...") @@ -87,7 +87,7 @@ if(lungs) owner.visible_message("[owner] vomits up his [lungs.name]!", "You suddenly vomit up your [lungs.name]!") owner.vomit(0, TRUE, TRUE, 1, FALSE, FALSE, FALSE, TRUE) - lungs.Remove(owner) + lungs.Remove() lungs.forceMove(owner.drop_location()) else to_chat(owner, "You feel a weird rumble inside your chest...") @@ -102,7 +102,7 @@ if(eyes) owner.visible_message("[owner]'s [eyes.name] fall out of their sockets!", "Your [eyes.name] fall out of their sockets!") playsound(owner, 'sound/effects/splat.ogg', 50, TRUE) - eyes.Remove(owner) + eyes.Remove() eyes.forceMove(owner.drop_location()) else to_chat(owner, "You feel a weird rumble behind your eye sockets...") diff --git a/code/modules/antagonists/changeling/powers/headcrab.dm b/code/modules/antagonists/changeling/powers/headcrab.dm index 1e06fb39de..4ef0d2f240 100644 --- a/code/modules/antagonists/changeling/powers/headcrab.dm +++ b/code/modules/antagonists/changeling/powers/headcrab.dm @@ -18,7 +18,7 @@ var/list/organs = user.getorganszone(BODY_ZONE_HEAD, 1) for(var/obj/item/organ/I in organs) - I.Remove(user, 1) + I.Remove(TRUE) explosion(get_turf(user), 0, 0, 2, 0, TRUE) for(var/mob/living/carbon/human/H in range(2,user)) diff --git a/code/modules/antagonists/changeling/powers/panacea.dm b/code/modules/antagonists/changeling/powers/panacea.dm index 2a0451bc76..17d82ec72d 100644 --- a/code/modules/antagonists/changeling/powers/panacea.dm +++ b/code/modules/antagonists/changeling/powers/panacea.dm @@ -22,7 +22,7 @@ if(!istype(O)) continue - O.Remove(user) + O.Remove() if(iscarbon(user)) var/mob/living/carbon/C = user C.vomit(0, toxic = TRUE) diff --git a/code/modules/antagonists/clockcult/clock_items/soul_vessel.dm b/code/modules/antagonists/clockcult/clock_items/soul_vessel.dm index d84338faea..f83afebe24 100644 --- a/code/modules/antagonists/clockcult/clock_items/soul_vessel.dm +++ b/code/modules/antagonists/clockcult/clock_items/soul_vessel.dm @@ -104,6 +104,6 @@ transfer_personality(H) brainmob.fully_replace_character_name(null, "[braintype] [H.real_name]") name = "[initial(name)] ([brainmob.name])" - B.Remove(H) + B.Remove() qdel(B) H.update_hair() diff --git a/code/modules/antagonists/slaughter/slaughter.dm b/code/modules/antagonists/slaughter/slaughter.dm index c669ff7877..c703c85762 100644 --- a/code/modules/antagonists/slaughter/slaughter.dm +++ b/code/modules/antagonists/slaughter/slaughter.dm @@ -100,10 +100,9 @@ if(M.mind) M.mind.AddSpell(new /obj/effect/proc_holder/spell/bloodcrawl(null)) -/obj/item/organ/heart/demon/Remove(mob/living/carbon/M, special = 0) - ..() - if(M.mind) - M.mind.RemoveSpell(/obj/effect/proc_holder/spell/bloodcrawl) +/obj/item/organ/heart/demon/Remove(special = FALSE) + owner?.mind?.RemoveSpell(/obj/effect/proc_holder/spell/bloodcrawl) + return ..() /obj/item/organ/heart/demon/Stop() return 0 // Always beating. diff --git a/code/modules/cargo/supplypod.dm b/code/modules/cargo/supplypod.dm index 5f3d6dab0a..adfbe3308a 100644 --- a/code/modules/cargo/supplypod.dm +++ b/code/modules/cargo/supplypod.dm @@ -114,7 +114,7 @@ for(var/X in CM.internal_organs) var/destination = get_edge_target_turf(T, pick(GLOB.alldirs)) //Pick a random direction to toss them in var/obj/item/organ/O = X - O.Remove(CM) //Note that this isn't the same proc as for lists + O.Remove() //Note that this isn't the same proc as for lists O.forceMove(T) //Move the organ outta the body O.throw_at(destination, 2, 3) //Thow the organ at a random tile 3 spots away sleep(1) diff --git a/code/modules/mining/equipment/regenerative_core.dm b/code/modules/mining/equipment/regenerative_core.dm index ed0fc8e9bc..e8ba72e62f 100644 --- a/code/modules/mining/equipment/regenerative_core.dm +++ b/code/modules/mining/equipment/regenerative_core.dm @@ -111,8 +111,8 @@ preserved(TRUE) owner.visible_message("[src] stabilizes as it's inserted.") -/obj/item/organ/regenerative_core/Remove(mob/living/carbon/M, special = 0) - if(!inert && !special) +/obj/item/organ/regenerative_core/Remove(special = FALSE) + if(!inert && !special && !QDELETED(owner)) owner.visible_message("[src] rapidly decays as it's removed.") go_inert() return ..() diff --git a/code/modules/mob/living/brain/brain_item.dm b/code/modules/mob/living/brain/brain_item.dm index 15cab5fc64..a14fdb0b53 100644 --- a/code/modules/mob/living/brain/brain_item.dm +++ b/code/modules/mob/living/brain/brain_item.dm @@ -55,16 +55,18 @@ //Update the body's icon so it doesnt appear debrained anymore C.update_hair() -/obj/item/organ/brain/Remove(mob/living/carbon/C, special = 0, no_id_transfer = FALSE) - ..() +/obj/item/organ/brain/Remove(special = FALSE, no_id_transfer = FALSE) + . = ..() + var/mob/living/carbon/C = . for(var/X in traumas) var/datum/brain_trauma/BT = X BT.on_lose(TRUE) BT.owner = null - if((!gc_destroyed || (owner && !owner.gc_destroyed)) && !no_id_transfer) + if((!QDELETED(src) || C) && !no_id_transfer) transfer_identity(C) - C.update_hair() + if(C) + C.update_hair() /obj/item/organ/brain/prepare_eat() return // Too important to eat. diff --git a/code/modules/mob/living/carbon/alien/organs.dm b/code/modules/mob/living/carbon/alien/organs.dm index 35751e4b86..febd0a024a 100644 --- a/code/modules/mob/living/carbon/alien/organs.dm +++ b/code/modules/mob/living/carbon/alien/organs.dm @@ -20,9 +20,10 @@ M.AddAbility(P) -/obj/item/organ/alien/Remove(mob/living/carbon/M, special = 0) - for(var/obj/effect/proc_holder/alien/P in alien_powers) - M.RemoveAbility(P) +/obj/item/organ/alien/Remove(special = FALSE) + if(owner) + for(var/obj/effect/proc_holder/alien/P in alien_powers) + owner.RemoveAbility(P) ..() /obj/item/organ/alien/prepare_eat() @@ -100,11 +101,11 @@ var/mob/living/carbon/alien/A = M A.updatePlasmaDisplay() -/obj/item/organ/alien/plasmavessel/Remove(mob/living/carbon/M, special = 0) - ..() - if(isalien(M)) - var/mob/living/carbon/alien/A = M +/obj/item/organ/alien/plasmavessel/Remove(special = FALSE) + if(owner && isalien(owner)) + var/mob/living/carbon/alien/A = owner A.updatePlasmaDisplay() + return ..() #define QUEEN_DEATH_DEBUFF_DURATION 2400 @@ -121,9 +122,10 @@ ..() M.faction |= ROLE_ALIEN -/obj/item/organ/alien/hivenode/Remove(mob/living/carbon/M, special = 0) - M.faction -= ROLE_ALIEN - ..() +/obj/item/organ/alien/hivenode/Remove(special = FALSE) + if(owner) + owner.faction -= ROLE_ALIEN + return ..() //When the alien queen dies, all aliens suffer a penalty as punishment for failing to protect her. /obj/item/organ/alien/hivenode/proc/queen_death() diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm index 6123c5b60f..126bcd1ba2 100644 --- a/code/modules/mob/living/carbon/carbon.dm +++ b/code/modules/mob/living/carbon/carbon.dm @@ -533,7 +533,7 @@ break //Guess we're out of organs! var/obj/item/organ/guts = pick(internal_organs) var/turf/T = get_turf(src) - guts.Remove(src) + guts.Remove() guts.forceMove(T) var/atom/throw_target = get_edge_target_turf(guts, dir) guts.throw_at(throw_target, power, 4, src) @@ -872,7 +872,7 @@ var/obj/item/organ/O = X if(prob(50)) organs_amt++ - O.Remove(src) + O.Remove() O.forceMove(drop_location()) if(organs_amt) to_chat(user, "You retrieve some of [src]\'s internal organs!") diff --git a/code/modules/mob/living/carbon/death.dm b/code/modules/mob/living/carbon/death.dm index 109672ab82..e0c394b2e0 100644 --- a/code/modules/mob/living/carbon/death.dm +++ b/code/modules/mob/living/carbon/death.dm @@ -43,7 +43,7 @@ continue var/org_zone = check_zone(O.zone) //both groin and chest organs. if(org_zone == BODY_ZONE_CHEST) - O.Remove(src) + O.Remove() O.forceMove(Tsec) O.throw_at(get_edge_target_turf(src,pick(GLOB.alldirs)),rand(1,3),5) else @@ -55,7 +55,7 @@ if(no_organs && !istype(I, /obj/item/organ/brain)) qdel(I) continue - I.Remove(src) + I.Remove() I.forceMove(Tsec) I.throw_at(get_edge_target_turf(src,pick(GLOB.alldirs)),rand(1,3),5) diff --git a/code/modules/mob/living/carbon/human/species.dm b/code/modules/mob/living/carbon/human/species.dm index 3357cc9ffe..d85a79f943 100644 --- a/code/modules/mob/living/carbon/human/species.dm +++ b/code/modules/mob/living/carbon/human/species.dm @@ -189,21 +189,21 @@ GLOBAL_LIST_EMPTY(roundstart_race_names) if(brain && (replace_current || !should_have_brain)) if(!brain.decoy_override)//Just keep it if it's fake - brain.Remove(C,TRUE,TRUE) + brain.Remove(TRUE,TRUE) QDEL_NULL(brain) if(should_have_brain && !brain) brain = new mutant_brain() brain.Insert(C, TRUE, TRUE) if(heart && (!should_have_heart || replace_current)) - heart.Remove(C,1) + heart.Remove(TRUE) QDEL_NULL(heart) if(should_have_heart && !heart) heart = new mutant_heart() heart.Insert(C) if(lungs && (!should_have_lungs || replace_current)) - lungs.Remove(C,1) + lungs.Remove(TRUE) QDEL_NULL(lungs) if(should_have_lungs && !lungs) if(mutantlungs) @@ -213,7 +213,7 @@ GLOBAL_LIST_EMPTY(roundstart_race_names) lungs.Insert(C) if(liver && (!should_have_liver || replace_current)) - liver.Remove(C,1) + liver.Remove(TRUE) QDEL_NULL(liver) if(should_have_liver && !liver) if(mutantliver) @@ -223,7 +223,7 @@ GLOBAL_LIST_EMPTY(roundstart_race_names) liver.Insert(C) if(stomach && (!should_have_stomach || replace_current)) - stomach.Remove(C,1) + stomach.Remove(TRUE) QDEL_NULL(stomach) if(should_have_stomach && !stomach) if(mutantstomach) @@ -233,14 +233,14 @@ GLOBAL_LIST_EMPTY(roundstart_race_names) stomach.Insert(C) if(appendix && (!should_have_appendix || replace_current)) - appendix.Remove(C,1) + appendix.Remove(TRUE) QDEL_NULL(appendix) if(should_have_appendix && !appendix) appendix = new() appendix.Insert(C) if(tail && (!should_have_tail || replace_current)) - tail.Remove(C,1) + tail.Remove(TRUE) QDEL_NULL(tail) if(should_have_tail && !tail) tail = new mutanttail() @@ -248,21 +248,21 @@ GLOBAL_LIST_EMPTY(roundstart_race_names) if(C.get_bodypart(BODY_ZONE_HEAD)) if(eyes && (replace_current || !should_have_eyes)) - eyes.Remove(C,1) + eyes.Remove(TRUE) QDEL_NULL(eyes) if(should_have_eyes && !eyes) eyes = new mutanteyes eyes.Insert(C, TRUE) if(ears && (replace_current || !should_have_ears)) - ears.Remove(C,1) + ears.Remove(TRUE) QDEL_NULL(ears) if(should_have_ears && !ears) ears = new mutantears ears.Insert(C) if(tongue && (replace_current || !should_have_tongue)) - tongue.Remove(C,1) + tongue.Remove(TRUE) QDEL_NULL(tongue) if(should_have_tongue && !tongue) tongue = new mutanttongue @@ -272,7 +272,7 @@ GLOBAL_LIST_EMPTY(roundstart_race_names) for(var/mutantorgan in old_species.mutant_organs) var/obj/item/organ/I = C.getorgan(mutantorgan) if(I) - I.Remove(C) + I.Remove() QDEL_NULL(I) for(var/path in mutant_organs) @@ -1601,7 +1601,7 @@ GLOBAL_LIST_EMPTY(roundstart_race_names) "\The [user] slaps \the [target]'s ass!",\ "You slap [user == target ? "your" : "\the [target]'s"] ass!",\ "You hear a slap." - ) + ) return FALSE else if(attacker_style && attacker_style.disarm_act(user,target)) return 1 diff --git a/code/modules/mob/living/carbon/human/species_types/felinid.dm b/code/modules/mob/living/carbon/human/species_types/felinid.dm index ec58a3be9c..5801e163e5 100644 --- a/code/modules/mob/living/carbon/human/species_types/felinid.dm +++ b/code/modules/mob/living/carbon/human/species_types/felinid.dm @@ -88,7 +88,7 @@ if(NT) NT.Insert(H, drop_if_replaced = FALSE) else - tail.Remove(H) + tail.Remove() /proc/mass_purrbation() for(var/M in GLOB.mob_list) diff --git a/code/modules/mob/living/carbon/human/species_types/shadowpeople.dm b/code/modules/mob/living/carbon/human/species_types/shadowpeople.dm index a0291631dc..49af501942 100644 --- a/code/modules/mob/living/carbon/human/species_types/shadowpeople.dm +++ b/code/modules/mob/living/carbon/human/species_types/shadowpeople.dm @@ -84,10 +84,10 @@ shadowwalk = SW -/obj/item/organ/brain/nightmare/Remove(mob/living/carbon/M, special = 0) - if(shadowwalk) - M.RemoveSpell(shadowwalk) - ..() +/obj/item/organ/brain/nightmare/Remove(special = FALSE) + if(shadowwalk && owner) + owner.RemoveSpell(shadowwalk) + return ..() /obj/item/organ/heart/nightmare @@ -120,12 +120,12 @@ blade = new/obj/item/light_eater M.put_in_hands(blade) -/obj/item/organ/heart/nightmare/Remove(mob/living/carbon/M, special = 0) +/obj/item/organ/heart/nightmare/Remove(special = FALSE) respawn_progress = 0 - if(blade && special != HEART_SPECIAL_SHADOWIFY) - M.visible_message("\The [blade] disintegrates!") + if(!QDELETED(owner) && blade && special != HEART_SPECIAL_SHADOWIFY) + owner.visible_message("\The [blade] disintegrates!") QDEL_NULL(blade) - ..() + return ..() /obj/item/organ/heart/nightmare/Stop() return 0 @@ -146,7 +146,7 @@ owner.revive(full_heal = TRUE) if(!(owner.dna.species.id == "shadow" || owner.dna.species.id == "nightmare")) var/mob/living/carbon/old_owner = owner - Remove(owner, HEART_SPECIAL_SHADOWIFY) + Remove(HEART_SPECIAL_SHADOWIFY) old_owner.set_species(/datum/species/shadow) Insert(old_owner, HEART_SPECIAL_SHADOWIFY) to_chat(owner, "You feel the shadows invade your skin, leaping into the center of your chest! You're alive!") diff --git a/code/modules/mob/living/simple_animal/hostile/cat_butcher.dm b/code/modules/mob/living/simple_animal/hostile/cat_butcher.dm index a9e167c6e6..5181e920d7 100644 --- a/code/modules/mob/living/simple_animal/hostile/cat_butcher.dm +++ b/code/modules/mob/living/simple_animal/hostile/cat_butcher.dm @@ -38,7 +38,7 @@ var/obj/item/organ/tail/cat/tail = L.getorgan(/obj/item/organ/tail/cat) if(!QDELETED(tail)) visible_message("[src] severs [L]'s tail in one swift swipe!", "You sever [L]'s tail in one swift swipe.") - tail.Remove(L) + tail.Remove() var/obj/item/organ/tail/cat/dropped_tail = new(target.drop_location()) dropped_tail.color = L.hair_color return 1 diff --git a/code/modules/mob/living/simple_animal/hostile/headcrab.dm b/code/modules/mob/living/simple_animal/hostile/headcrab.dm index 80e0172f45..cc225f4bac 100644 --- a/code/modules/mob/living/simple_animal/hostile/headcrab.dm +++ b/code/modules/mob/living/simple_animal/hostile/headcrab.dm @@ -61,7 +61,7 @@ time++ if(time >= EGG_INCUBATION_TIME) Pop() - Remove(owner) + Remove() qdel(src) /obj/item/organ/body_egg/changeling_egg/proc/Pop() diff --git a/code/modules/mob/transform_procs.dm b/code/modules/mob/transform_procs.dm index 4af6b4d644..b660c50ab7 100644 --- a/code/modules/mob/transform_procs.dm +++ b/code/modules/mob/transform_procs.dm @@ -90,7 +90,7 @@ if(tr_flags & TR_KEEPORGANS) for(var/X in O.internal_organs) var/obj/item/organ/I = X - I.Remove(O, 1) + I.Remove(TRUE) if(mind) mind.transfer_to(O) @@ -103,7 +103,7 @@ for(var/X in internal_organs) var/obj/item/organ/I = X int_organs += I - I.Remove(src, 1) + I.Remove(TRUE) for(var/X in int_organs) var/obj/item/organ/I = X @@ -250,7 +250,7 @@ if(tr_flags & TR_KEEPORGANS) for(var/X in O.internal_organs) var/obj/item/organ/I = X - I.Remove(O, 1) + I.Remove(TRUE) if(mind) mind.transfer_to(O) @@ -262,7 +262,7 @@ for(var/X in internal_organs) var/obj/item/organ/I = X int_organs += I - I.Remove(src, 1) + I.Remove(TRUE) for(var/X in int_organs) var/obj/item/organ/I = X diff --git a/code/modules/power/supermatter/supermatter.dm b/code/modules/power/supermatter/supermatter.dm index ee93767a0c..008fab7669 100644 --- a/code/modules/power/supermatter/supermatter.dm +++ b/code/modules/power/supermatter/supermatter.dm @@ -555,7 +555,7 @@ GLOBAL_DATUM(main_supermatter_engine, /obj/machinery/power/supermatter_crystal) to_chat(C, "That was a really dense idea.") C.visible_message("A bright flare of radiation is seen from [C]'s head, shortly before you hear a sickening sizzling!") var/obj/item/organ/brain/rip_u = locate(/obj/item/organ/brain) in C.internal_organs - rip_u.Remove(C) + rip_u.Remove() qdel(rip_u) return return ..() diff --git a/code/modules/power/tesla/energy_ball.dm b/code/modules/power/tesla/energy_ball.dm index f8d25c0c9c..13f53f14d0 100644 --- a/code/modules/power/tesla/energy_ball.dm +++ b/code/modules/power/tesla/energy_ball.dm @@ -136,7 +136,7 @@ to_chat(C, "That was a shockingly dumb idea.") C.visible_message("A bright flare of lightning is seen from [C]'s head, shortly before you hear a sickening sizzling!") var/obj/item/organ/brain/rip_u = locate(/obj/item/organ/brain) in C.internal_organs - rip_u.Remove(C) + rip_u.Remove() qdel(rip_u) return return ..() diff --git a/code/modules/projectiles/guns/ballistic.dm b/code/modules/projectiles/guns/ballistic.dm index fd40f437ca..9ea50562dd 100644 --- a/code/modules/projectiles/guns/ballistic.dm +++ b/code/modules/projectiles/guns/ballistic.dm @@ -163,7 +163,7 @@ user.visible_message("[user] blows [user.p_their()] brain[user.p_s()] out with [src]!") playsound(src, 'sound/weapons/dink.ogg', 30, 1) var/turf/target = get_ranged_target_turf(user, turn(user.dir, 180), BRAINS_BLOWN_THROW_RANGE) - B.Remove(user) + B.Remove() B.forceMove(T) if(iscarbon(user)) var/mob/living/carbon/C = user diff --git a/code/modules/reagents/chemistry/reagents/alcohol_reagents.dm b/code/modules/reagents/chemistry/reagents/alcohol_reagents.dm index 103f7cb28f..810124b2ba 100644 --- a/code/modules/reagents/chemistry/reagents/alcohol_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/alcohol_reagents.dm @@ -197,7 +197,7 @@ All effects don't start immediately, but rather get worse over time; the rate is var/obj/item/organ/eyes/eyes = M.getorganslot(ORGAN_SLOT_EYES) if(HAS_TRAIT(M, TRAIT_BLIND)) if(eyes) - eyes.Remove(M) + eyes.Remove() eyes.forceMove(get_turf(M)) to_chat(M, "You double over in pain as you feel your eyeballs liquify in your head!") M.emote("scream") diff --git a/code/modules/spells/spell_types/lichdom.dm b/code/modules/spells/spell_types/lichdom.dm index 0cbb3a8272..86597d5d2e 100644 --- a/code/modules/spells/spell_types/lichdom.dm +++ b/code/modules/spells/spell_types/lichdom.dm @@ -144,7 +144,7 @@ C.dropItemToGround(W) for(var/X in C.internal_organs) var/obj/item/organ/I = X - I.Remove(C) + I.Remove() I.forceMove(body_turf) var/wheres_wizdo = dir2text(get_dir(body_turf, item_turf)) if(wheres_wizdo) diff --git a/code/modules/spells/spell_types/summonitem.dm b/code/modules/spells/spell_types/summonitem.dm index 7d9823e29b..c4b184cc9b 100644 --- a/code/modules/spells/spell_types/summonitem.dm +++ b/code/modules/spells/spell_types/summonitem.dm @@ -58,7 +58,7 @@ if(organ.owner) // If this code ever runs I will be happy log_combat(L, organ.owner, "magically removed [organ.name] from", addition="INTENT: [uppertext(L.a_intent)]") - organ.Remove(organ.owner) + organ.Remove() else while(!isturf(item_to_retrieve.loc) && infinite_recursion < 10) //if it's in something you get the whole thing. if(isitem(item_to_retrieve.loc)) diff --git a/code/modules/surgery/bodyparts/dismemberment.dm b/code/modules/surgery/bodyparts/dismemberment.dm index 31fc90cb04..61811cdafc 100644 --- a/code/modules/surgery/bodyparts/dismemberment.dm +++ b/code/modules/surgery/bodyparts/dismemberment.dm @@ -62,7 +62,7 @@ var/org_zone = check_zone(O.zone) if(org_zone != BODY_ZONE_CHEST) continue - O.Remove(C) + O.Remove() O.forceMove(T) organ_spilled = 1 . += X @@ -141,11 +141,11 @@ //when a limb is dropped, the internal organs are removed from the mob and put into the limb /obj/item/organ/proc/transfer_to_limb(obj/item/bodypart/LB, mob/living/carbon/C) - Remove(C) + Remove() forceMove(LB) /obj/item/organ/brain/transfer_to_limb(obj/item/bodypart/head/LB, mob/living/carbon/human/C) - Remove(C) //Changeling brain concerns are now handled in Remove + Remove() //Changeling brain concerns are now handled in Remove forceMove(LB) LB.brain = src if(brainmob) diff --git a/code/modules/surgery/nutcracker.dm b/code/modules/surgery/nutcracker.dm index 9722d8af87..d5827df084 100644 --- a/code/modules/surgery/nutcracker.dm +++ b/code/modules/surgery/nutcracker.dm @@ -17,7 +17,7 @@ var/list/organs = M.getorganszone("head") + M.getorganszone("eyes") + M.getorganszone("mouth") for(var/internal_organ in organs) var/obj/item/organ/I = internal_organ - I.Remove(M) + I.Remove() I.forceMove(T) head.drop_limb() qdel(head) diff --git a/code/modules/surgery/organ_manipulation.dm b/code/modules/surgery/organ_manipulation.dm index 699b3f7f24..f493137424 100644 --- a/code/modules/surgery/organ_manipulation.dm +++ b/code/modules/surgery/organ_manipulation.dm @@ -136,7 +136,7 @@ "[user] successfully extracts [I] from [target]'s [parse_zone(target_zone)]!", "[user] successfully extracts something from [target]'s [parse_zone(target_zone)]!") log_combat(user, target, "surgically removed [I.name] from", addition="INTENT: [uppertext(user.a_intent)]") - I.Remove(target) + I.Remove() I.forceMove(get_turf(target)) else display_results(user, target, "You can't extract anything from [target]'s [parse_zone(target_zone)]!", diff --git a/code/modules/surgery/organs/appendix.dm b/code/modules/surgery/organs/appendix.dm index 8ea4ea855d..feace77018 100644 --- a/code/modules/surgery/organs/appendix.dm +++ b/code/modules/surgery/organs/appendix.dm @@ -27,10 +27,11 @@ icon_state = "appendix" name = "appendix" -/obj/item/organ/appendix/Remove(mob/living/carbon/M, special = 0) - for(var/datum/disease/appendicitis/A in M.diseases) - A.cure() - inflamed = TRUE +/obj/item/organ/appendix/Remove(special = FALSE) + if(owner) + for(var/datum/disease/appendicitis/A in owner.diseases) + A.cure() + inflamed = TRUE update_icon() ..() diff --git a/code/modules/surgery/organs/augments_arms.dm b/code/modules/surgery/organs/augments_arms.dm index 503bf4ddd0..792facd360 100644 --- a/code/modules/surgery/organs/augments_arms.dm +++ b/code/modules/surgery/organs/augments_arms.dm @@ -54,7 +54,7 @@ to_chat(user, "You modify [src] to be installed on the [zone == BODY_ZONE_R_ARM ? "right" : "left"] arm.") update_icon() -/obj/item/organ/cyberimp/arm/Remove(mob/living/carbon/M, special = 0) +/obj/item/organ/cyberimp/arm/Remove(special = FALSE) Retract() ..() diff --git a/code/modules/surgery/organs/augments_chest.dm b/code/modules/surgery/organs/augments_chest.dm index b2beeebe78..8426440bbb 100644 --- a/code/modules/surgery/organs/augments_chest.dm +++ b/code/modules/surgery/organs/augments_chest.dm @@ -147,10 +147,10 @@ ion_trail = new ion_trail.set_up(M) -/obj/item/organ/cyberimp/chest/thrusters/Remove(mob/living/carbon/M, special = 0) +/obj/item/organ/cyberimp/chest/thrusters/Remove(special = FALSE) if(on) - toggle(silent = TRUE) - ..() + toggle(TRUE) + return ..() /obj/item/organ/cyberimp/chest/thrusters/ui_action_click() toggle() @@ -170,10 +170,11 @@ to_chat(owner, "You turn your thrusters set on.") else ion_trail.stop() - UnregisterSignal(owner, COMSIG_MOVABLE_MOVED) - owner.remove_movespeed_modifier(MOVESPEED_ID_CYBER_THRUSTER) - if(!silent) - to_chat(owner, "You turn your thrusters set off.") + if(!QDELETED(owner)) + UnregisterSignal(owner, COMSIG_MOVABLE_MOVED) + owner.remove_movespeed_modifier(MOVESPEED_ID_CYBER_THRUSTER) + if(!silent) + to_chat(owner, "You turn your thrusters set off.") on = FALSE update_icon() diff --git a/code/modules/surgery/organs/augments_eyes.dm b/code/modules/surgery/organs/augments_eyes.dm index 86732ae2eb..be9120cdfa 100644 --- a/code/modules/surgery/organs/augments_eyes.dm +++ b/code/modules/surgery/organs/augments_eyes.dm @@ -20,11 +20,11 @@ var/datum/atom_hud/H = GLOB.huds[HUD_type] H.add_hud_to(M) -/obj/item/organ/cyberimp/eyes/hud/Remove(var/mob/living/carbon/M, var/special = 0) - if(HUD_type) +/obj/item/organ/cyberimp/eyes/hud/Remove(special = FALSE) + if(!QDELETED(owner) && HUD_type) var/datum/atom_hud/H = GLOB.huds[HUD_type] - H.remove_hud_from(M) - ..() + H.remove_hud_from(owner) + return ..() /obj/item/organ/cyberimp/eyes/hud/medical name = "Medical HUD implant" diff --git a/code/modules/surgery/organs/augments_internal.dm b/code/modules/surgery/organs/augments_internal.dm index f487e61d38..01cd4acbed 100644 --- a/code/modules/surgery/organs/augments_internal.dm +++ b/code/modules/surgery/organs/augments_internal.dm @@ -89,10 +89,10 @@ stored_items = list() -/obj/item/organ/cyberimp/brain/anti_drop/Remove(var/mob/living/carbon/M, special = 0) +/obj/item/organ/cyberimp/brain/anti_drop/Remove(special = FALSE) if(active) ui_action_click() - ..() + return ..() /obj/item/organ/cyberimp/brain/anti_stun diff --git a/code/modules/surgery/organs/ears.dm b/code/modules/surgery/organs/ears.dm index 0d3002915e..65847042a1 100644 --- a/code/modules/surgery/organs/ears.dm +++ b/code/modules/surgery/organs/ears.dm @@ -104,13 +104,14 @@ H.dna.features["ears"] = "Cat" H.update_body() -/obj/item/organ/ears/cat/Remove(mob/living/carbon/human/H, special = 0) - ..() - if(istype(H)) +/obj/item/organ/ears/cat/Remove(special = FALSE) + if(!QDELETED(owner) && ishuman(owner)) + var/mob/living/carbon/human/H = owner color = H.hair_color H.dna.features["ears"] = "None" H.dna.species.mutant_bodyparts -= "ears" H.update_body() + return ..() /obj/item/organ/ears/bronze name = "tin ears" diff --git a/code/modules/surgery/organs/eyes.dm b/code/modules/surgery/organs/eyes.dm index c09d1ac1fc..5b47e18ac7 100644 --- a/code/modules/surgery/organs/eyes.dm +++ b/code/modules/surgery/organs/eyes.dm @@ -47,17 +47,19 @@ M.update_tint() owner.update_sight() -/obj/item/organ/eyes/Remove(mob/living/carbon/M, special = 0) +/obj/item/organ/eyes/Remove(special = FALSE) clear_eye_trauma() . = ..() - if(ishuman(M) && eye_color) - var/mob/living/carbon/human/H = M - H.eye_color = old_eye_color + var/mob/living/carbon/C = . + if(C) + if(ishuman(C) && eye_color) + var/mob/living/carbon/human/H = C + H.eye_color = old_eye_color + if(!special) + H.dna.species.handle_body() if(!special) - H.dna.species.handle_body() - if(!special) - M.update_tint() - M.update_sight() + C.update_tint() + C.update_sight() /obj/item/organ/eyes/on_life() ..() @@ -185,13 +187,13 @@ eye.update_brightness(M) M.become_blind("flashlight_eyes") - -/obj/item/organ/eyes/robotic/flashlight/Remove(var/mob/living/carbon/M, special = FALSE) - eye.on = FALSE - eye.update_brightness(M) - eye.forceMove(src) - M.cure_blind("flashlight_eyes") - ..() +/obj/item/organ/eyes/robotic/flashlight/Remove(special = FALSE) + if(!QDELETED(owner)) + eye.on = FALSE + eye.update_brightness(owner) + eye.forceMove(src) + owner.cure_blind("flashlight_eyes") + return ..() // Welding shield implant /obj/item/organ/eyes/robotic/shield @@ -227,7 +229,7 @@ terminate_effects() . = ..() -/obj/item/organ/eyes/robotic/glow/Remove(mob/living/carbon/M, special = FALSE) +/obj/item/organ/eyes/robotic/glow/Remove(special = FALSE) terminate_effects() . = ..() @@ -236,7 +238,6 @@ deactivate(TRUE) active = FALSE clear_visuals(TRUE) - STOP_PROCESSING(SSfastprocess, src) /obj/item/organ/eyes/robotic/glow/ui_action_click(owner, action) if(istype(action, /datum/action/item_action/organ_action/toggle)) diff --git a/code/modules/surgery/organs/heart.dm b/code/modules/surgery/organs/heart.dm index 51784bdc61..05657724d2 100644 --- a/code/modules/surgery/organs/heart.dm +++ b/code/modules/surgery/organs/heart.dm @@ -28,10 +28,10 @@ else icon_state = "[icon_base]-off" -/obj/item/organ/heart/Remove(mob/living/carbon/M, special = 0) - ..() +/obj/item/organ/heart/Remove(special = FALSE) if(!special) - addtimer(CALLBACK(src, .proc/stop_if_unowned), 120) + addtimer(CALLBACK(src, .proc/stop_if_unowned), 12 SECONDS) + return ..() /obj/item/organ/heart/proc/stop_if_unowned() if(!owner) @@ -145,9 +145,9 @@ obj/item/organ/heart/slime if(owner) to_chat(owner, "Your heart has been replaced with a cursed one, you have to pump this one manually otherwise you'll die!") -/obj/item/organ/heart/cursed/Remove(mob/living/carbon/M, special = 0) - ..() - M.remove_client_colour(/datum/client_colour/cursed_heart_blood) +/obj/item/organ/heart/cursed/Remove(special = FALSE) + owner.remove_client_colour(/datum/client_colour/cursed_heart_blood) + return ..() /datum/action/item_action/organ_action/cursed_heart name = "Pump your blood" diff --git a/code/modules/surgery/organs/liver.dm b/code/modules/surgery/organs/liver.dm index fc70e64a82..680d2389de 100755 --- a/code/modules/surgery/organs/liver.dm +++ b/code/modules/surgery/organs/liver.dm @@ -58,12 +58,12 @@ return S //Just in case -/obj/item/organ/liver/Remove(mob/living/carbon/M, special = 0) - ..() - if(!QDELETED(M)) - M.remove_movespeed_modifier(LIVER_SWELLING_MOVE_MODIFY) - M.ResetBloodVol() //At the moment, this shouldn't allow application twice. You either have this OR a thirsty ferret. - sizeMoveMod(1, M) +/obj/item/organ/liver/Remove(special = FALSE) + if(!QDELETED(owner)) + owner.remove_movespeed_modifier(LIVER_SWELLING_MOVE_MODIFY) + owner.ResetBloodVol() //At the moment, this shouldn't allow application twice. You either have this OR a thirsty ferret. + sizeMoveMod(1, owner) + return ..() //Applies some of the effects to the patient. /obj/item/organ/liver/proc/pharmacokinesis() diff --git a/code/modules/surgery/organs/organ_internal.dm b/code/modules/surgery/organs/organ_internal.dm index fcbed13d94..b091af0f92 100644 --- a/code/modules/surgery/organs/organ_internal.dm +++ b/code/modules/surgery/organs/organ_internal.dm @@ -33,7 +33,7 @@ var/obj/item/organ/replaced = M.getorganslot(slot) if(replaced) - replaced.Remove(M, special = 1) + replaced.Remove(TRUE) if(drop_if_replaced) replaced.forceMove(get_turf(M)) else @@ -54,21 +54,20 @@ return TRUE //Special is for instant replacement like autosurgeons -/obj/item/organ/proc/Remove(mob/living/carbon/M, special = FALSE) +/obj/item/organ/proc/Remove(special = FALSE) + if(owner) + owner.internal_organs -= src + if(owner.internal_organs_slot[slot] == src) + owner.internal_organs_slot.Remove(slot) + if((organ_flags & ORGAN_VITAL) && !special && !(owner.status_flags & GODMODE)) + owner.death() + for(var/X in actions) + var/datum/action/A = X + A.Remove(owner) + . = owner //for possible subtypes specific post-removal code. owner = null - if(M) - M.internal_organs -= src - if(M.internal_organs_slot[slot] == src) - M.internal_organs_slot.Remove(slot) - if((organ_flags & ORGAN_VITAL) && !special && !(M.status_flags & GODMODE)) - M.death() - for(var/X in actions) - var/datum/action/A = X - A.Remove(M) START_PROCESSING(SSobj, src) - return TRUE - /obj/item/organ/proc/on_find(mob/living/finder) return @@ -185,7 +184,7 @@ if(owner) // The special flag is important, because otherwise mobs can die // while undergoing transformation into different mobs. - Remove(owner, TRUE) + Remove(TRUE) return ..() /obj/item/organ/attack(mob/living/carbon/M, mob/user) @@ -338,7 +337,7 @@ T = new dna.species.mutanttongue() else T = new() - oT.Remove(src) + oT.Remove() qdel(oT) T.Insert(src) diff --git a/code/modules/surgery/organs/stomach.dm b/code/modules/surgery/organs/stomach.dm index 93210fe3ff..94f88cbe67 100755 --- a/code/modules/surgery/organs/stomach.dm +++ b/code/modules/surgery/organs/stomach.dm @@ -80,9 +80,9 @@ H.throw_alert("disgust", /obj/screen/alert/disgusted) SEND_SIGNAL(H, COMSIG_ADD_MOOD_EVENT, "disgust", /datum/mood_event/disgusted) -/obj/item/organ/stomach/Remove(mob/living/carbon/M, special = 0) +/obj/item/organ/stomach/Remove(special = FALSE) var/mob/living/carbon/human/H = owner - if(istype(H)) + if(H && istype(H)) H.clear_alert("disgust") SEND_SIGNAL(H, COMSIG_CLEAR_MOOD_EVENT, "disgust") ..() diff --git a/code/modules/surgery/organs/tails.dm b/code/modules/surgery/organs/tails.dm index b6701643a9..fe881df221 100644 --- a/code/modules/surgery/organs/tails.dm +++ b/code/modules/surgery/organs/tails.dm @@ -8,10 +8,10 @@ slot = ORGAN_SLOT_TAIL var/tail_type = "None" -/obj/item/organ/tail/Remove(mob/living/carbon/human/H, special = 0) - ..() - if(H && H.dna && H.dna.species) - H.dna.species.stop_wagging_tail(H) +/obj/item/organ/tail/Remove(special = FALSE) + if(owner?.dna?.species) + owner.dna.species.stop_wagging_tail(owner) + return ..() /obj/item/organ/tail/cat name = "cat tail" @@ -26,13 +26,14 @@ H.dna.features["tail_human"] = tail_type H.update_body() -/obj/item/organ/tail/cat/Remove(mob/living/carbon/human/H, special = 0) - ..() - if(istype(H)) +/obj/item/organ/tail/cat/Remove(special = FALSE) + if(!QDELETED(owner) && ishuman(owner)) + var/mob/living/carbon/human/H = owner H.dna.features["tail_human"] = "None" H.dna.species.mutant_bodyparts -= "tail_human" color = H.hair_color H.update_body() + return ..() /obj/item/organ/tail/lizard name = "lizard tail" @@ -54,12 +55,13 @@ H.dna.species.mutant_bodyparts |= "spines" H.update_body() -/obj/item/organ/tail/lizard/Remove(mob/living/carbon/human/H, special = 0) - ..() - if(istype(H)) +/obj/item/organ/tail/lizard/Remove(special = FALSE) + if(!QDELETED(owner) && ishuman(owner)) + var/mob/living/carbon/human/H = owner H.dna.species.mutant_bodyparts -= "tail_lizard" H.dna.species.mutant_bodyparts -= "spines" color = "#" + H.dna.features["mcolor"] tail_type = H.dna.features["tail_lizard"] spines = H.dna.features["spines"] H.update_body() + return ..() diff --git a/code/modules/surgery/organs/tongue.dm b/code/modules/surgery/organs/tongue.dm index 760cd97f08..7693dfb071 100644 --- a/code/modules/surgery/organs/tongue.dm +++ b/code/modules/surgery/organs/tongue.dm @@ -71,12 +71,13 @@ RegisterSignal(M, COMSIG_MOB_SAY, .proc/handle_speech) M.UnregisterSignal(M, COMSIG_MOB_SAY) -/obj/item/organ/tongue/Remove(mob/living/carbon/M, special = 0) - ..() - if(say_mod && M.dna && M.dna.species) - M.dna.species.say_mod = initial(M.dna.species.say_mod) - UnregisterSignal(M, COMSIG_MOB_SAY, .proc/handle_speech) - M.RegisterSignal(M, COMSIG_MOB_SAY, /mob/living/carbon/.proc/handle_tongueless_speech) +/obj/item/organ/tongue/Remove(special = FALSE) + if(!QDELETED(owner)) + if(say_mod && owner.dna?.species) + owner.dna.species.say_mod = initial(owner.dna.species.say_mod) + UnregisterSignal(owner, COMSIG_MOB_SAY, .proc/handle_speech) + owner.RegisterSignal(owner, COMSIG_MOB_SAY, /mob/living/carbon/.proc/handle_tongueless_speech) + return ..() /obj/item/organ/tongue/could_speak_in_language(datum/language/dt) return is_type_in_typecache(dt, languages_possible) diff --git a/code/modules/zombie/organs.dm b/code/modules/zombie/organs.dm index ccadca56e5..59c6a321e6 100644 --- a/code/modules/zombie/organs.dm +++ b/code/modules/zombie/organs.dm @@ -27,13 +27,14 @@ . = ..() START_PROCESSING(SSobj, src) -/obj/item/organ/zombie_infection/Remove(mob/living/carbon/M, special = 0) +/obj/item/organ/zombie_infection/Remove(special = FALSE) + if(owner) + if(iszombie(owner) && old_species) + owner.set_species(old_species) + if(timer_id) + deltimer(timer_id) . = ..() - STOP_PROCESSING(SSobj, src) - if(iszombie(M) && old_species) - M.set_species(old_species) - if(timer_id) - deltimer(timer_id) + STOP_PROCESSING(SSobj, src) //Required to be done after the parent call to avoid conflicts with organ decay. /obj/item/organ/zombie_infection/on_find(mob/living/finder) to_chat(finder, "Inside the head is a disgusting black \ @@ -44,7 +45,7 @@ if(!owner) return if(!(src in owner.internal_organs)) - Remove(owner) + Remove() if (causes_damage && !iszombie(owner) && owner.stat != DEAD) owner.adjustToxLoss(1) if (prob(10)) diff --git a/modular_citadel/code/modules/arousal/genitals.dm b/modular_citadel/code/modules/arousal/genitals.dm index a16617ba3f..865db28f42 100644 --- a/modular_citadel/code/modules/arousal/genitals.dm +++ b/modular_citadel/code/modules/arousal/genitals.dm @@ -35,8 +35,6 @@ /obj/item/organ/genital/Destroy() if(linked_organ) update_link(TRUE)//this should remove any other links it has - if(owner) - Remove(owner, TRUE)//this should remove references to it, so it can be GCd correctly return ..() /obj/item/organ/genital/proc/set_aroused_state(new_state) @@ -203,10 +201,9 @@ RegisterSignal(owner, COMSIG_MOB_DEATH, .proc/update_appearance) /obj/item/organ/genital/Remove(mob/living/carbon/M, special = FALSE, drop_if_replaced = TRUE) - . = ..() - if(.) - update(TRUE) - UnregisterSignal(M, COMSIG_MOB_DEATH) + update(TRUE) + if(!QDELETED(owner)) + UnregisterSignal(owner, COMSIG_MOB_DEATH) //proc to give a player their genitals and stuff when they log in /mob/living/carbon/human/proc/give_genitals(clean = FALSE)//clean will remove all pre-existing genitals. proc will then give them any genitals that are enabled in their DNA diff --git a/modular_citadel/code/modules/reagents/chemistry/reagents/MKUltra.dm b/modular_citadel/code/modules/reagents/chemistry/reagents/MKUltra.dm index f935fc5092..2364c617f0 100644 --- a/modular_citadel/code/modules/reagents/chemistry/reagents/MKUltra.dm +++ b/modular_citadel/code/modules/reagents/chemistry/reagents/MKUltra.dm @@ -191,7 +191,7 @@ Creating a chem with a low purity will make you permanently fall in love with so var/obj/item/organ/vocal_cords/Vc = M.getorganslot(ORGAN_SLOT_VOICE) var/obj/item/organ/vocal_cords/nVc = new /obj/item/organ/vocal_cords/velvet if(Vc) - Vc.Remove(M) + Vc.Remove() nVc.Insert(M) qdel(Vc) to_chat(M, "You feel your vocal chords tingle you speak in a more charasmatic and sultry tone.") diff --git a/modular_citadel/code/modules/reagents/chemistry/reagents/SDGF.dm b/modular_citadel/code/modules/reagents/chemistry/reagents/SDGF.dm index 87615ccb68..5f9ea5924d 100644 --- a/modular_citadel/code/modules/reagents/chemistry/reagents/SDGF.dm +++ b/modular_citadel/code/modules/reagents/chemistry/reagents/SDGF.dm @@ -94,7 +94,7 @@ IMPORTANT FACTORS TO CONSIDER WHILE BALANCING //I seriously wonder if anyone will ever use this function. if(M.getorganslot(ORGAN_SLOT_ZOMBIE))//sure, it "treats" it, but "you've" still got it. Doesn't always work as well; needs a ghost. var/obj/item/organ/zombie_infection/ZI = M.getorganslot(ORGAN_SLOT_ZOMBIE) - ZI.Remove(M) + ZI.Remove() ZI.Insert(SM) log_game("FERMICHEM: [M] ckey: [M.key]'s zombie_infection has been transferred to their clone") diff --git a/modular_citadel/code/modules/reagents/chemistry/reagents/fermi_reagents.dm b/modular_citadel/code/modules/reagents/chemistry/reagents/fermi_reagents.dm index e9c5733584..fb5574855e 100644 --- a/modular_citadel/code/modules/reagents/chemistry/reagents/fermi_reagents.dm +++ b/modular_citadel/code/modules/reagents/chemistry/reagents/fermi_reagents.dm @@ -129,7 +129,7 @@ if(16) T = M.getorganslot(ORGAN_SLOT_TONGUE) var/obj/item/organ/tongue/nT = new /obj/item/organ/tongue/fluffy - T.Remove(M) + T.Remove() nT.Insert(M) T.moveToNullspace()//To valhalla to_chat(M, "Your tongue feels... weally fwuffy!!") @@ -152,7 +152,7 @@ /datum/reagent/fermi/furranium/on_mob_delete(mob/living/carbon/M) if(cached_purity < 0.95)//Only permanent if you're a good chemist. nT = M.getorganslot(ORGAN_SLOT_TONGUE) - nT.Remove(M) + nT.Remove() qdel(nT) T.Insert(M) to_chat(M, "You feel your tongue.... unfluffify...?") diff --git a/modular_citadel/code/modules/reagents/chemistry/reagents/healing.dm b/modular_citadel/code/modules/reagents/chemistry/reagents/healing.dm index 8668ef76f0..d98ec7059d 100644 --- a/modular_citadel/code/modules/reagents/chemistry/reagents/healing.dm +++ b/modular_citadel/code/modules/reagents/chemistry/reagents/healing.dm @@ -29,7 +29,7 @@ nT = new C.dna.species.mutanttongue() else nT = new() - T.Remove(C) + T.Remove() qdel(T) nT.Insert(C) to_chat(C, "You feel your tongue.... unfluffify...?") @@ -57,7 +57,7 @@ T = new C.dna.species.mutanttongue() else T = new() - oT.Remove(C) + oT.Remove() qdel(oT) T.Insert(C) to_chat(C, "You feel your tongue.... unfluffify...?")