From 90378d4da9b1c7fc3fedbaa8801eac4d8951086f Mon Sep 17 00:00:00 2001 From: Elizabeth Lavenza Date: Thu, 28 Mar 2024 18:14:24 -0400 Subject: [PATCH] Fix direct Destroy calls --- code/datums/mutations/antenna.dm | 2 +- code/modules/admin/verbs/randomverbs.dm | 2 +- .../shuttle_creation/shuttle_creator.dm | 8 +++--- code/modules/vehicles/mecha/combat/neovgre.dm | 3 ++- .../code/modules/mob/living/carbon/carbon.dm | 26 ------------------- .../code/modules/mob/living/living.dm | 24 +++++++++++++++++ .../modules/antagonists/wendigo/datums_hud.dm | 10 +++---- 7 files changed, 36 insertions(+), 39 deletions(-) diff --git a/code/datums/mutations/antenna.dm b/code/datums/mutations/antenna.dm index 54139f74a0..410224ffa0 100644 --- a/code/datums/mutations/antenna.dm +++ b/code/datums/mutations/antenna.dm @@ -29,7 +29,7 @@ if(..()) return if(linked_radio) - linked_radio.Destroy() + QDEL_NULL(linked_radio) /datum/mutation/human/antenna/New(class_ = MUT_OTHER, timer, datum/mutation/human/copymut) ..() diff --git a/code/modules/admin/verbs/randomverbs.dm b/code/modules/admin/verbs/randomverbs.dm index db34e607c6..4f4616729f 100644 --- a/code/modules/admin/verbs/randomverbs.dm +++ b/code/modules/admin/verbs/randomverbs.dm @@ -1494,7 +1494,7 @@ Traitors and the like can also be revived with the previous role mostly intact. to_chat(usr, "[C] is dead!") return else - C.pregoodbye(C) //sandstorm punish and ends here. + C.goodbye(C) //sandstorm punish and ends here. if(ADMIN_PUNISHMENT_TABLETIDESTATIONWIDE) //SPLURT punishments start here priority_announce(html_decode("[target] has brought the wrath of the gods upon themselves and is now being tableslammed across the station. Please stand by."), null, 'sound/misc/announce.ogg', "CentCom") var/list/areas = list() diff --git a/code/modules/shuttle/shuttle_creation/shuttle_creator.dm b/code/modules/shuttle/shuttle_creation/shuttle_creator.dm index ac604fbe49..222cbd2ed7 100644 --- a/code/modules/shuttle/shuttle_creation/shuttle_creator.dm +++ b/code/modules/shuttle/shuttle_creation/shuttle_creator.dm @@ -198,8 +198,8 @@ GLOBAL_LIST_EMPTY(custom_shuttle_machines) //Machines that require updating (He var/invertedDir = invertDir(portDirection) if(!portDirection || !invertedDir) to_chat(usr, "Shuttle creation aborted, docking airlock must be on an external wall. Please select a new airlock.") - port.Destroy() - stationary_port.Destroy() + QDEL_NULL(port) + QDEL_NULL(stationary_port) linkedShuttleId = null return FALSE port.dir = invertedDir @@ -207,8 +207,8 @@ GLOBAL_LIST_EMPTY(custom_shuttle_machines) //Machines that require updating (He if(!calculate_bounds(port)) to_chat(usr, "Bluespace calculations failed, please select a new airlock.") - port.Destroy() - stationary_port.Destroy() + QDEL_NULL(port) + QDEL_NULL(stationary_port) linkedShuttleId = null return FALSE diff --git a/code/modules/vehicles/mecha/combat/neovgre.dm b/code/modules/vehicles/mecha/combat/neovgre.dm index 7e40a1c352..e4f5b89e39 100644 --- a/code/modules/vehicles/mecha/combat/neovgre.dm +++ b/code/modules/vehicles/mecha/combat/neovgre.dm @@ -53,7 +53,8 @@ /obj/vehicle/sealed/mecha/combat/neovgre/proc/go_critical() explosion(get_turf(loc), 3, 5, 10, 20, 30) - Destroy(src) + if(!QDELETED(src)) + qdel(src) /obj/vehicle/sealed/mecha/combat/neovgre/container_resist(mob/living/user) to_chat(user, "Neovgre requires a lifetime commitment friend, no backing out now!") diff --git a/modular_sand/code/modules/mob/living/carbon/carbon.dm b/modular_sand/code/modules/mob/living/carbon/carbon.dm index 11251e980a..2ef2c9e493 100644 --- a/modular_sand/code/modules/mob/living/carbon/carbon.dm +++ b/modular_sand/code/modules/mob/living/carbon/carbon.dm @@ -25,29 +25,3 @@ hud_used.thirst.icon_state = "hydration3" if(0 to THIRST_LEVEL_PARCHED) hud_used.thirst.icon_state = "hydration4" - -//It's here so it doesn't make a big mess on randomverbs.dm, -//also because of this you can proccall it, why would you if you have smite? -/mob/living/proc/pregoodbye(C) - if(isanimal(C)) - var/mob/living/simple_animal/D = C - D.toggle_ai(AI_OFF) - AllImmobility(900, TRUE, TRUE) // Complete 15 minutes of stun, hopefully they shouldn't take that long - playsound(C, "modular_sand/sound/effects/admin_punish/changetheworld.ogg", 100, FALSE) - say("Change the world") - stoplag(20) - playsound(C, "modular_sand/sound/effects/admin_punish/myfinalmessage.ogg", 100, FALSE) - say("My final message") - stoplag(20) - playsound(C, "modular_sand/sound/effects/admin_punish/goodbye.ogg", 100, FALSE) - say("Goodbye.") - stoplag(20) - playsound(C, "modular_sand/sound/effects/admin_punish/endjingle.ogg", 100, FALSE) - goodbye() - -/mob/living/proc/goodbye() //this must be separate because it's a loop! - while(alpha >= 10) - alpha = alpha - 7 - stoplag(1) - stoplag(2) - Destroy() diff --git a/modular_sand/code/modules/mob/living/living.dm b/modular_sand/code/modules/mob/living/living.dm index 4932a028ad..59c460efa7 100644 --- a/modular_sand/code/modules/mob/living/living.dm +++ b/modular_sand/code/modules/mob/living/living.dm @@ -34,3 +34,27 @@ mob_size = MOB_SIZE_HUMAN if(1.21 to INFINITY) mob_size = MOB_SIZE_LARGE + +//It's here so it doesn't make a big mess on randomverbs.dm, +//also because of this you can proccall it, why would you if you have smite? +// This code was bad. For future reference, stoplag() and sleep() are very different and not at all interchangeable. +// You can also use animate() to cleanly animate variables like alpha. +// Finally, NEVER call Destroy() directly. +/mob/living/proc/goodbye(C) + set waitfor = FALSE + if(isanimal(C)) + var/mob/living/simple_animal/D = C + D.toggle_ai(AI_OFF) + AllImmobility(900, TRUE, TRUE) // Complete 15 minutes of stun, hopefully they shouldn't take that long + playsound(C, "modular_sand/sound/effects/admin_punish/changetheworld.ogg", 100, FALSE) + say("Change the world") + sleep(20) + playsound(C, "modular_sand/sound/effects/admin_punish/myfinalmessage.ogg", 100, FALSE) + say("My final message") + sleep(20) + playsound(C, "modular_sand/sound/effects/admin_punish/goodbye.ogg", 100, FALSE) + say("Goodbye.") + sleep(20) + playsound(C, "modular_sand/sound/effects/admin_punish/endjingle.ogg", 100, FALSE) + animate(src, alpha = 10, 3.5 SECONDS) + QDEL_IN(src, 2) diff --git a/modular_splurt/code/modules/antagonists/wendigo/datums_hud.dm b/modular_splurt/code/modules/antagonists/wendigo/datums_hud.dm index b65da31371..19c78e4d7c 100644 --- a/modular_splurt/code/modules/antagonists/wendigo/datums_hud.dm +++ b/modular_splurt/code/modules/antagonists/wendigo/datums_hud.dm @@ -9,13 +9,11 @@ related to the antag that could be a datum antagpanel_category = "Wendigo" /datum/antagonist/wendigo/on_gain() - if(istype(owner.current, /mob/living/carbon/human)) + var/mob/living/carbon/human/old_body = owner.current + if(ishuman(old_body)) var/mob/living/carbon/wendigo/new_owner = new/mob/living/carbon/wendigo(get_turf(owner.current)) - var/mob/current_body = owner.current - current_body.transfer_ckey(new_owner) - current_body.Destroy() - owner = new_owner.mind - owner.current = new_owner + qdel(old_body) + owner.transfer_to(new_owner) ..() //HUD