diff --git a/code/game/gamemodes/endgame/supermatter_cascade/blob.dm b/code/game/gamemodes/endgame/supermatter_cascade/blob.dm index 88da43257d..abdee1922a 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. @@ -117,4 +117,4 @@ if(istype(user,/mob/observer)) return - qdel(user) + qdel(user) \ No newline at end of file diff --git a/code/game/turfs/simulated/floor_types.dm b/code/game/turfs/simulated/floor_types.dm index 88f24dbbb4..69ead276ad 100644 --- a/code/game/turfs/simulated/floor_types.dm +++ b/code/game/turfs/simulated/floor_types.dm @@ -21,7 +21,6 @@ /obj/landed_holder/proc/land_on(var/turf/T) //Gather destination information var/obj/landed_holder/new_holder = new(null) - T.lighting_clear_overlay() new_holder.turf_type = T.type new_holder.dir = T.dir new_holder.icon = T.icon @@ -31,14 +30,12 @@ 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) - my_turf.lighting_clear_overlay() new_dest.set_dir(my_turf.dir) new_dest.icon_state = my_turf.icon_state new_dest.icon = my_turf.icon new_dest.copy_overlays(my_turf, TRUE) - new_dest.underlays = my_turf.underlays.Copy() + new_dest.underlays = my_turf.underlays new_dest.decals = my_turf.decals //Shuttle specific stuff new_dest.interior_corner = my_turf.interior_corner @@ -46,7 +43,6 @@ new_dest.under_turf = my_turf.under_turf new_dest.join_flags = my_turf.join_flags new_dest.join_group = my_turf.join_group - new_dest.lighting_build_overlay() // Associate the holder with the new turf. new_holder.my_turf = new_dest @@ -63,14 +59,12 @@ //Change our source to whatever it was before if(turf_type) new_source = my_turf.ChangeTurf(turf_type,,1) - new_source.lighting_clear_overlay() new_source.set_dir(dir) new_source.icon_state = icon_state new_source.icon = icon new_source.copy_overlays(src, TRUE) - new_source.underlays = underlays.Copy() + new_source.underlays = underlays new_source.decals = decals - new_source.lighting_build_overlay() else new_source = my_turf.ChangeTurf(base_turf ? base_turf : get_base_turf_by_area(my_turf),,1) @@ -102,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() @@ -117,7 +111,7 @@ /turf/simulated/shuttle/proc/underlay_update() if(!takes_underlays) //Basically, if it's not forced, and we don't care, don't do it. - return //CHOMP Edit removed 0. Sarcastically quoting the above comment ^ "Basically, if it's not stupposed to store a fucking value, don't store a fucking value." + return 0 var/turf/under //May be a path or a turf var/mutable_appearance/us = new(src) //We'll use this for changes later @@ -294,4 +288,4 @@ /turf/simulated/shuttle/floor/voidcraft/external/dark -/turf/simulated/shuttle/floor/voidcraft/external/light +/turf/simulated/shuttle/floor/voidcraft/external/light \ No newline at end of file diff --git a/code/game/turfs/simulated/walls.dm b/code/game/turfs/simulated/walls.dm index b916884129..26b960c417 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)) @@ -332,11 +331,4 @@ to_chat(user, span("notice", "You deconstruct \the [src].")) ChangeTurf(/turf/simulated/floor/airless, preserve_outdoors = TRUE) return TRUE - return FALSE - -/turf/simulated/wall/AltClick(mob/user) - if(isliving(user)) - var/mob/living/livingUser = user - if(try_graffiti(livingUser, livingUser.get_active_hand())) - return - . = ..() + return FALSE \ No newline at end of file diff --git a/code/game/turfs/turf.dm b/code/game/turfs/turf.dm index fab9cf4c04..c70a81a8a8 100644 --- a/code/game/turfs/turf.dm +++ b/code/game/turfs/turf.dm @@ -30,11 +30,11 @@ var/movement_cost = 0 // How much the turf slows down movement, if any. var/list/footstep_sounds = null - var/list/vorefootstep_sounds = null //CHOMPstation edit 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) . = ..() @@ -59,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 @@ -311,7 +316,7 @@ /turf/proc/try_graffiti(var/mob/vandal, var/obj/item/tool) - if(!tool || !tool.sharp || !can_engrave()) + if(!tool.sharp || !can_engrave()) return FALSE if(jobban_isbanned(vandal, "Graffiti")) @@ -408,4 +413,4 @@ return // We were the the B-side in a turf translation /turf/proc/post_translate_B(var/turf/A) - return + return \ No newline at end of file diff --git a/code/game/turfs/turf_changing.dm b/code/game/turfs/turf_changing.dm index 5c51101c52..295ebab221 100644 --- a/code/game/turfs/turf_changing.dm +++ b/code/game/turfs/turf_changing.dm @@ -61,49 +61,29 @@ cut_overlays(TRUE) RemoveElement(/datum/element/turf_z_transparency) + changing_turf = TRUE + qdel(src) + var/turf/W = new N( locate(src.x, src.y, src.z) ) if(ispath(N, /turf/simulated/floor)) - var/turf/simulated/W = new N( locate(src.x, src.y, src.z) ) 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 @@ -132,4 +112,4 @@ space_tile.update_starlight() if(preserve_outdoors) - outdoors = old_outdoors + outdoors = old_outdoors \ No newline at end of file diff --git a/code/game/turfs/unsimulated/planetary.dm b/code/game/turfs/unsimulated/planetary.dm index 8e08b8d26d..d1b522361c 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) @@ -67,4 +67,3 @@ oxygen = MOLES_O2STANDARD nitrogen = MOLES_N2STANDARD temperature = 310.92 // About 37.7C / 100F - diff --git a/code/modules/admin/view_variables/admin_delete.dm b/code/modules/admin/view_variables/admin_delete.dm index 7976d3bedf..9907d65618 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", "") + vv_update_display(D, "deleted", "") \ No newline at end of file diff --git a/code/modules/artifice/deadringer.dm b/code/modules/artifice/deadringer.dm index b10c05c942..b7912ec89e 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) \ No newline at end of file diff --git a/code/modules/mob/freelook/update_triggers.dm b/code/modules/mob/freelook/update_triggers.dm index a678ff319c..02d36e54f5 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 78fb4084cd..d6b710209a 100644 --- a/code/modules/turbolift/turbolift.dm +++ b/code/modules/turbolift/turbolift.dm @@ -223,4 +223,4 @@ #undef LIFT_MOVING #undef LIFT_WAITING_A -#undef LIFT_WAITING_B +#undef LIFT_WAITING_B \ No newline at end of file diff --git a/code/modules/xenobio2/mob/xeno.dm b/code/modules/xenobio2/mob/xeno.dm index 9996be9e61..2effd32e26 100644 --- a/code/modules/xenobio2/mob/xeno.dm +++ b/code/modules/xenobio2/mob/xeno.dm @@ -101,7 +101,6 @@ Also includes Life and New stasis += hit.stasisforce ..() -/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) ..() \ 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 a9989c3c45..91d66d429b 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