diff --git a/code/game/gamemodes/endgame/supermatter_cascade/blob.dm b/code/game/gamemodes/endgame/supermatter_cascade/blob.dm index 88da43257da..af29065f96a 100644 --- a/code/game/gamemodes/endgame/supermatter_cascade/blob.dm +++ b/code/game/gamemodes/endgame/supermatter_cascade/blob.dm @@ -21,7 +21,7 @@ /turf/unsimulated/wall/supermatter/Destroy() STOP_PROCESSING(SSturfs, src) - ..() + return ..() /turf/unsimulated/wall/supermatter/process() // Only check infrequently. diff --git a/code/game/turfs/simulated/floor_types.dm b/code/game/turfs/simulated/floor_types.dm index 486e215325f..b63ecf01436 100644 --- a/code/game/turfs/simulated/floor_types.dm +++ b/code/game/turfs/simulated/floor_types.dm @@ -30,7 +30,6 @@ new_holder.decals = T.decals ? T.decals.Copy() : null //Set the destination to be like us - T.Destroy() var/turf/simulated/shuttle/new_dest = T.ChangeTurf(my_turf.type,,1) new_dest.set_dir(my_turf.dir) new_dest.icon_state = my_turf.icon_state @@ -97,7 +96,7 @@ /turf/simulated/shuttle/Destroy() landed_holder = null - ..() + return ..() // For joined corners touching static lighting turfs, add an overlay to cancel out that part of our lighting overlay. /turf/simulated/shuttle/proc/update_breaklights() diff --git a/code/game/turfs/simulated/walls.dm b/code/game/turfs/simulated/walls.dm index d0bb6d56404..f46d0c3105d 100644 --- a/code/game/turfs/simulated/walls.dm +++ b/code/game/turfs/simulated/walls.dm @@ -45,8 +45,7 @@ /turf/simulated/wall/Destroy() STOP_PROCESSING(SSturfs, src) - dismantle_wall(null,null,1) - ..() + return ..() /turf/simulated/wall/examine_icon() return icon(icon=initial(icon), icon_state=initial(icon_state)) diff --git a/code/game/turfs/turf.dm b/code/game/turfs/turf.dm index bcd53322b86..c70a81a8a85 100644 --- a/code/game/turfs/turf.dm +++ b/code/game/turfs/turf.dm @@ -34,6 +34,7 @@ var/block_tele = FALSE // If true, most forms of teleporting to or from this turf tile will fail. var/can_build_into_floor = FALSE // Used for things like RCDs (and maybe lattices/floor tiles in the future), to see if a floor should replace it. var/list/dangerous_objects // List of 'dangerous' objs that the turf holds that can cause something bad to happen when stepped on, used for AI mobs. + var/tmp/changing_turf /turf/Initialize(mapload) . = ..() @@ -58,9 +59,14 @@ Be.multiz_turf_new(src, UP) /turf/Destroy() - . = QDEL_HINT_IWILLGC + if (!changing_turf) + crash_with("Improper turf qdel. Do not qdel turfs directly.") + changing_turf = FALSE cleanbot_reserved_turfs -= src + if(connections) + connections.erase_all() ..() + return QDEL_HINT_IWILLGC /turf/ex_act(severity) return 0 diff --git a/code/game/turfs/turf_changing.dm b/code/game/turfs/turf_changing.dm index 492f3ef65b8..5d95cb499a3 100644 --- a/code/game/turfs/turf_changing.dm +++ b/code/game/turfs/turf_changing.dm @@ -43,6 +43,7 @@ var/old_dangerous_objects = dangerous_objects var/old_dynamic_lumcount = dynamic_lumcount +<<<<<<< HEAD var/turf/Ab = GetAbove(src) if(Ab) Ab.multiz_turf_del(src, DOWN) @@ -64,46 +65,31 @@ if(ispath(N, /turf/simulated/floor)) var/turf/simulated/W = new N( locate(src.x, src.y, src.z) ) +======= + changing_turf = TRUE + qdel(src) + + var/turf/W = new N( locate(src.x, src.y, src.z) ) + if(istype(W, /turf/simulated/floor)) +>>>>>>> a7877d86e50... Merge pull request #8341 from MistakeNot4892/qdel if(old_fire) - fire = old_fire + W.fire = old_fire + W.RemoveLattice() + else if(old_fire) + old_fire.RemoveFire() - if (istype(W,/turf/simulated/floor)) - W.RemoveLattice() + if(tell_universe) + universe.OnTurfChange(W) - if(tell_universe) - universe.OnTurfChange(W) + if(air_master) + air_master.mark_for_update(W) - if(air_master) - air_master.mark_for_update(src) //handle the addition of the new turf. - - for(var/turf/space/S in range(W,1)) - S.update_starlight() - - W.levelupdate() - W.update_icon(1) - W.post_change() - . = W - - else - - var/turf/W = new N( locate(src.x, src.y, src.z) ) - - if(old_fire) - old_fire.RemoveFire() - - if(tell_universe) - universe.OnTurfChange(W) - - if(air_master) - air_master.mark_for_update(src) - - for(var/turf/space/S in range(W,1)) - S.update_starlight() - - W.levelupdate() - W.update_icon(1) - W.post_change() - . = W + for(var/turf/space/S in range(W, 1)) + S.update_starlight() + W.levelupdate() + W.update_icon(1) + W.post_change() + . = W dangerous_objects = old_dangerous_objects diff --git a/code/game/turfs/unsimulated/planetary.dm b/code/game/turfs/unsimulated/planetary.dm index 8e08b8d26d7..c6be94c5ed0 100644 --- a/code/game/turfs/unsimulated/planetary.dm +++ b/code/game/turfs/unsimulated/planetary.dm @@ -24,7 +24,7 @@ /turf/unsimulated/wall/planetary/Destroy() SSplanets.removeTurf(src) - ..() + return ..() /turf/unsimulated/wall/planetary/proc/set_temperature(var/new_temperature) if(new_temperature == temperature) diff --git a/code/modules/admin/view_variables/admin_delete.dm b/code/modules/admin/view_variables/admin_delete.dm index 7976d3bedf4..4f9c048fe61 100644 --- a/code/modules/admin/view_variables/admin_delete.dm +++ b/code/modules/admin/view_variables/admin_delete.dm @@ -19,6 +19,13 @@ T.ScrapeAway() else*/ vv_update_display(D, "deleted", VV_MSG_DELETED) - qdel(D) + + // turfs are special snowflakes that'll explode if qdel'd outside ChangeTurf + if (isturf(D)) + var/turf/T = D + T.ChangeTurf(world.turf) + else + qdel(D) + if(!QDELETED(D)) vv_update_display(D, "deleted", "") diff --git a/code/modules/artifice/deadringer.dm b/code/modules/artifice/deadringer.dm index b10c05c9427..d0774dc2a57 100644 --- a/code/modules/artifice/deadringer.dm +++ b/code/modules/artifice/deadringer.dm @@ -172,7 +172,4 @@ corpse.adjustBruteLoss(H.getBruteLoss()) corpse.UpdateAppearance() corpse.regenerate_icons() - for(var/obj/item/organ/internal/I in corpse.internal_organs) - var/obj/item/organ/internal/G = I - G.Destroy() - return + QDEL_NULL_LIST(corpse.internal_organs) diff --git a/code/modules/mob/freelook/update_triggers.dm b/code/modules/mob/freelook/update_triggers.dm index a678ff319c9..02d36e54f56 100644 --- a/code/modules/mob/freelook/update_triggers.dm +++ b/code/modules/mob/freelook/update_triggers.dm @@ -15,6 +15,12 @@ /turf/simulated/Destroy() updateVisibility(src) + if(zone) + if(can_safely_remove_from_zone()) + c_copy_air() + zone.remove(src) + else + zone.rebuild() return ..() /turf/simulated/Initialize() diff --git a/code/modules/turbolift/turbolift.dm b/code/modules/turbolift/turbolift.dm index 78fb4084cd0..da2745bffc5 100644 --- a/code/modules/turbolift/turbolift.dm +++ b/code/modules/turbolift/turbolift.dm @@ -195,7 +195,11 @@ if(istype(AM, /mob/living) && !(AM.is_incorporeal())) var/mob/living/M = AM M.gib() +<<<<<<< HEAD else if(AM.simulated && !(istype(AM, /mob/observer)) && !(AM.is_incorporeal())) +======= + else if(istype(AM, /mob/zshadow) || (AM.simulated && !(istype(AM, /mob/observer)))) +>>>>>>> a7877d86e50... Merge pull request #8341 from MistakeNot4892/qdel qdel(AM) origin.move_contents_to(destination) diff --git a/code/modules/xenobio2/mob/xeno.dm b/code/modules/xenobio2/mob/xeno.dm index 9996be9e613..d50063081aa 100644 --- a/code/modules/xenobio2/mob/xeno.dm +++ b/code/modules/xenobio2/mob/xeno.dm @@ -101,7 +101,12 @@ Also includes Life and New stasis += hit.stasisforce ..() +<<<<<<< HEAD /mob/living/simple_mob/xeno/Destroy() traitdat.Destroy() //Let's clean up after ourselves. traitdat = null +======= +/mob/living/simple_animal/xeno/Destroy() + QDEL_NULL(traitdat) +>>>>>>> a7877d86e50... Merge pull request #8341 from MistakeNot4892/qdel ..() \ No newline at end of file diff --git a/code/modules/xenobio2/mob/xeno_product.dm b/code/modules/xenobio2/mob/xeno_product.dm index a9989c3c459..91d66d429bc 100644 --- a/code/modules/xenobio2/mob/xeno_product.dm +++ b/code/modules/xenobio2/mob/xeno_product.dm @@ -12,7 +12,6 @@ Xenobiological product lives here as a basic type. var/nameVar = "blah" /obj/item/xenoproduct/Destroy() - traits.Destroy() //Let's not leave any traits hanging around. - traits = null + QDEL_NULL(traits) ..() \ No newline at end of file