From f0fd0c9949ab21268ea3c5f5e1765617a0ebefae Mon Sep 17 00:00:00 2001 From: MrPerson Date: Tue, 25 Feb 2014 02:00:28 -0800 Subject: [PATCH] Fixed the nuke disk qdel() fucking up Made the singulo spawn correctly Really minor fix for things that are qdel()'d at 0 time, which should be nothing if everything is going right. --- code/game/atoms.dm | 4 +--- code/game/atoms_movable.dm | 12 ++++++------ code/game/gamemodes/nuclear/nuclearbomb.dm | 1 + code/modules/admin/verbs/debug.dm | 3 +-- code/modules/power/singularity/singularity.dm | 3 --- 5 files changed, 9 insertions(+), 14 deletions(-) diff --git a/code/game/atoms.dm b/code/game/atoms.dm index 949aacc1ce9..ab8288e6330 100644 --- a/code/game/atoms.dm +++ b/code/game/atoms.dm @@ -46,7 +46,7 @@ /atom/Del() // Pass to Destroy(). - if(!gc_destroyed) // If we're just straight up calling del(atom), make sure anything in Destroy() gets called anyways just to be sure. + if(isnull(gc_destroyed)) // If we're just straight up calling del(atom), make sure anything in Destroy() gets called anyways just to be sure. Destroy() ..() @@ -56,8 +56,6 @@ /atom/proc/Destroy() gc_destroyed = world.time invisibility = 101 - for(var/atom/movable/AM in contents) - qdel(AM) if(reagents) reagents.delete() del(reagents) // Technically I think the reagent holder will gc, but let's be careful here and delete all the reagents and the holder too diff --git a/code/game/atoms_movable.dm b/code/game/atoms_movable.dm index 15dad142851..53e58d0a13e 100644 --- a/code/game/atoms_movable.dm +++ b/code/game/atoms_movable.dm @@ -31,6 +31,12 @@ // testing("GC: [type] was deleted via GC with qdel()") ..() +/atom/movable/Destroy() + loc = null // can never null their loc enough really + for(var/atom/movable/AM in contents) + qdel(AM) + . = ..() + // Previously known as HasEntered() // This is automatically called when something enters your square /atom/movable/Crossed(atom/movable/AM) @@ -59,12 +65,6 @@ return 1 return 0 -/atom/movable/Destroy() - loc = null // can never null their loc enough really - for(var/atom/movable/AM in contents) - qdel(AM) - . = ..() - /atom/movable/proc/hit_check() // todo: this is partly obsolete due to passflags already, add throwing stuff to mob CanPass and finish it if(src.throwing) for(var/atom/A in get_turf(src)) diff --git a/code/game/gamemodes/nuclear/nuclearbomb.dm b/code/game/gamemodes/nuclear/nuclearbomb.dm index 71d45f0f2cf..cf4080a840d 100644 --- a/code/game/gamemodes/nuclear/nuclearbomb.dm +++ b/code/game/gamemodes/nuclear/nuclearbomb.dm @@ -210,3 +210,4 @@ var/bomb_set var/obj/D = new /obj/item/weapon/disk/nuclear(pick(blobstart)) message_admins("[src] has been destroyed. Spawning [D] at ([D.x], [D.y], [D.z]).") log_game("[src] has been destroyed. Spawning [D] at ([D.x], [D.y], [D.z]).") + ..() diff --git a/code/modules/admin/verbs/debug.dm b/code/modules/admin/verbs/debug.dm index 7c412684a46..d81126ba5e1 100644 --- a/code/modules/admin/verbs/debug.dm +++ b/code/modules/admin/verbs/debug.dm @@ -1058,8 +1058,7 @@ var/global/list/g_fancy_list_of_safe_types = null for(var/obj/machinery/the_singularitygen/G in world) if(G.anchored) var/obj/machinery/singularity/S = new /obj/machinery/singularity(get_turf(G), 50) - spawn(0) - del(G) +// qdel(G) S.energy = 1750 S.current_size = 7 S.icon = 'icons/effects/224x224.dmi' diff --git a/code/modules/power/singularity/singularity.dm b/code/modules/power/singularity/singularity.dm index b204357819e..7383574951b 100644 --- a/code/modules/power/singularity/singularity.dm +++ b/code/modules/power/singularity/singularity.dm @@ -38,9 +38,6 @@ var/global/list/uneatable = list( admin_investigate_setup() src.energy = starting_energy - if(temp) - spawn(temp) - qdel(src) ..() for(var/obj/machinery/singularity_beacon/singubeacon in world) if(singubeacon.active)