From 364d99aba89a3e53bb08e1708cf381e979dafdc9 Mon Sep 17 00:00:00 2001 From: kane-f <57303506+kane-f@users.noreply.github.com> Date: Tue, 26 Oct 2021 06:36:26 +0100 Subject: [PATCH] Makes diagonal wall containing turfs lit properly (#31143) * Makes diag wall turfs lit properly * Fixes * Trying this * Var fix * One def * Actually making them * On these apparently * Adding this here for New() sake * Not needed nor useful * Trying this * Now it works * Now it works * Moving here * Moving here * Removing unneeded code * Bringing this back * Bringing this back * Fix * Here too * Consistency * Old system Co-authored-by: kanef --- code/datums/shuttle.dm | 7 ------- code/game/area/areas.dm | 21 ++++++++++--------- code/game/turfs/simulated/shuttle.dm | 31 ++++++++++++++++++++++++++++ code/game/turfs/turf.dm | 5 ----- 4 files changed, 42 insertions(+), 22 deletions(-) diff --git a/code/datums/shuttle.dm b/code/datums/shuttle.dm index 130abd9611f..c8aadc58eb5 100644 --- a/code/datums/shuttle.dm +++ b/code/datums/shuttle.dm @@ -638,13 +638,6 @@ if(!old_turf) message_admins("ERROR when moving [src.name] ([src.type]) - failed to get original turf at [old_C.x_pos];[old_C.y_pos];[our_center.z]") continue - else if(old_turf.preserve_underlay == 0 && istype(old_turf,/turf/simulated/wall/shuttle)) //Varediting a turf's "preserve_underlay" to 1 will protect its underlay from being changed - if(old_turf.icon_state in transparent_icons) - add_underlay = 1 - if(old_turf.underlays.len) //this list is in code/game/area/areas.dm - var/image/I = locate(/image) in old_turf.underlays //bandaid - if(I.icon == 'icons/turf/shuttle.dmi') //Don't change underlay to space if CURRENT underlay is a shuttle floor! - add_underlay = 0 if(!new_turf) message_admins("ERROR when moving [src.name] ([src.type]) - failed to get new turf at [C.x_pos];[C.y_pos];[new_center.z]") diff --git a/code/game/area/areas.dm b/code/game/area/areas.dm index d11ad41127a..1d2bc25c28d 100644 --- a/code/game/area/areas.dm +++ b/code/game/area/areas.dm @@ -542,7 +542,6 @@ var/area/space_area var/list/ignored_keys = list("loc", "locs", "parent_type", "vars", "verbs", "type", "x", "y", "z", "group", "contents", "air", "zone", "light", "underlays", "lighting_overlay", "corners", "affecting_lights", "has_opaque_atom", "lighting_corners_initialised", "light_sources") var/list/moved_landmarks = list(latejoin, wizardstart) //Landmarks that are moved by move_area_to and move_contents_to -var/list/transparent_icons = list("diagonalWall3") //icon_states for which to prepare an underlay /area/proc/move_contents_to(var/area/A, var/turftoleave=null, var/direction = null) //Takes: Area. Optional: turf type to leave behind. @@ -641,17 +640,19 @@ var/list/transparent_icons = list("diagonalWall3") //icon_states for which to pr SX.air.copy_from(ST.zone.air) ST.zone.remove(ST) + + /* Quick visual fix for transit space tiles */ + if(direction && (locate(/obj/structure/shuttle/diag_wall) in X)) + // Find a new turf to take on the property of + var/turf/nextturf = get_step(X, direction) + if(!nextturf || !istype(nextturf, /turf/space)) + nextturf = get_step(X, turn(direction, 180)) + + // Take on the icon of a neighboring scrolling space icon + X.icon = nextturf.icon + X.icon_state = nextturf.icon_state for(var/obj/O in T) - - // Reset the shuttle corners - if(O.tag == "delete me") - X.icon = 'icons/turf/shuttle.dmi' - X.icon_state = replacetext(O.icon_state, "_f", "_s") // revert the turf to the old icon_state - X.name = "wall" - qdel(O) // prevents multiple shuttle corners from stacking - O = null - continue if(!istype(O,/obj)) continue O.forceMove(X) diff --git a/code/game/turfs/simulated/shuttle.dm b/code/game/turfs/simulated/shuttle.dm index d6ebaeee067..b42fe62dde2 100644 --- a/code/game/turfs/simulated/shuttle.dm +++ b/code/game/turfs/simulated/shuttle.dm @@ -76,6 +76,37 @@ anchored = 1 opacity = 1 +/obj/structure/shuttle/diag_wall/initialize() + var/turf/T = get_turf(src) + if(T) + T.dynamic_lighting = 1 + if(SSlighting && SSlighting.initialized && !T.lighting_overlay) + new /atom/movable/lighting_overlay(T, TRUE) + +/obj/structure/shuttle/diag_wall/New() + ..() + if(world.has_round_started()) + initialize() + +/obj/structure/shuttle/diag_wall/Destroy() + var/turf/T = get_turf(src) + if(istype(T,/turf/space)) + T.dynamic_lighting = 0 + T.lighting_clear_overlay() + ..() + +/obj/structure/shuttle/diag_wall/forceMove(atom/destination, no_tp=0, harderforce = FALSE, glide_size_override = 0) + var/turf/T = get_turf(src) + if(istype(T,/turf/space)) + T.dynamic_lighting = 0 + T.lighting_clear_overlay() + ..() + T = get_turf(destination) + if(T) + T.dynamic_lighting = 1 + if(!T.lighting_overlay) + new /atom/movable/lighting_overlay(T, TRUE) + /obj/structure/shuttle/diag_wall/Cross(atom/movable/mover, turf/target, height=1.5, air_group = 0) if(air_group) return 0 diff --git a/code/game/turfs/turf.dm b/code/game/turfs/turf.dm index 160db312aee..eeaa392b2b0 100644 --- a/code/game/turfs/turf.dm +++ b/code/game/turfs/turf.dm @@ -56,11 +56,6 @@ var/explosion_block = 0 - //For shuttles - if 1, the turf's underlay will never be changed when moved - //See code/datums/shuttle.dm @ 544 - var/preserve_underlay = 0 - - // This is the placed to store data for the holomap. var/list/image/holomap_data