mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 18:22:39 +00:00
Fix the ChangeTurf improvements PR, 3725
This commit is contained in:
@@ -21,7 +21,7 @@
|
||||
|
||||
/turf/unsimulated/wall/supermatter/Destroy()
|
||||
STOP_PROCESSING(SSturfs, src)
|
||||
..()
|
||||
return ..()
|
||||
|
||||
/turf/unsimulated/wall/supermatter/process()
|
||||
// Only check infrequently.
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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))
|
||||
@@ -333,10 +332,3 @@
|
||||
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
|
||||
. = ..()
|
||||
|
||||
@@ -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"))
|
||||
|
||||
@@ -61,45 +61,25 @@
|
||||
|
||||
cut_overlays(TRUE)
|
||||
RemoveElement(/datum/element/turf_z_transparency)
|
||||
|
||||
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
|
||||
|
||||
if (istype(W,/turf/simulated/floor))
|
||||
W.RemoveLattice()
|
||||
|
||||
if(tell_universe)
|
||||
universe.OnTurfChange(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
|
||||
changing_turf = TRUE
|
||||
qdel(src)
|
||||
|
||||
var/turf/W = new N( locate(src.x, src.y, src.z) )
|
||||
|
||||
if(ispath(N, /turf/simulated/floor))
|
||||
if(old_fire)
|
||||
W.fire = old_fire
|
||||
W.RemoveLattice()
|
||||
else if(old_fire)
|
||||
old_fire.RemoveFire()
|
||||
|
||||
if(tell_universe)
|
||||
universe.OnTurfChange(W)
|
||||
|
||||
if(air_master)
|
||||
air_master.mark_for_update(src)
|
||||
air_master.mark_for_update(W)
|
||||
|
||||
for(var/turf/space/S in range(W, 1))
|
||||
S.update_starlight()
|
||||
|
||||
W.levelupdate()
|
||||
W.update_icon(1)
|
||||
W.post_change()
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -19,6 +19,13 @@
|
||||
T.ScrapeAway()
|
||||
else*/
|
||||
vv_update_display(D, "deleted", VV_MSG_DELETED)
|
||||
|
||||
// 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", "")
|
||||
@@ -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)
|
||||
@@ -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()
|
||||
|
||||
@@ -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)
|
||||
..()
|
||||
@@ -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)
|
||||
..()
|
||||
|
||||
Reference in New Issue
Block a user