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 <kanef9x@protonmail.com>
This commit is contained in:
kane-f
2021-10-26 06:36:26 +01:00
committed by GitHub
parent 97ef4c190a
commit 364d99aba8
4 changed files with 42 additions and 22 deletions

View File

@@ -638,13 +638,6 @@
if(!old_turf) 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]") 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 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) 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]") message_admins("ERROR when moving [src.name] ([src.type]) - failed to get new turf at [C.x_pos];[C.y_pos];[new_center.z]")

View File

@@ -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/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/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) /area/proc/move_contents_to(var/area/A, var/turftoleave=null, var/direction = null)
//Takes: Area. Optional: turf type to leave behind. //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) SX.air.copy_from(ST.zone.air)
ST.zone.remove(ST) 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) 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)) if(!istype(O,/obj))
continue continue
O.forceMove(X) O.forceMove(X)

View File

@@ -76,6 +76,37 @@
anchored = 1 anchored = 1
opacity = 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) /obj/structure/shuttle/diag_wall/Cross(atom/movable/mover, turf/target, height=1.5, air_group = 0)
if(air_group) if(air_group)
return 0 return 0

View File

@@ -56,11 +56,6 @@
var/explosion_block = 0 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. // This is the placed to store data for the holomap.
var/list/image/holomap_data var/list/image/holomap_data