Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open turfs handle space below #471

Open
wants to merge 4 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion code/game/turfs/turf_changing.dm
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
// This makes sure that turfs are not changed to space when one side is part of a zone
if(N == /turf/space)
var/turf/below = GetBelow(src)
if(istype(below) && !istype(below,/turf/space))
if(istype(below))
N = /turf/simulated/open

var/old_air = air
Expand Down
18 changes: 18 additions & 0 deletions code/modules/multiz/turf.dm
Original file line number Diff line number Diff line change
Expand Up @@ -106,3 +106,21 @@
//Most things use is_plating to test if there is a cover tile on top (like regular floors)
/turf/simulated/open/is_plating()
return 1

// This is for handling light on open turfs above space turfs
/turf/simulated/open/update_mimic()
. = ..()
if(!.)
return
var/turf/T = GetBelow(src)
if(!istype(T))
return

if(T.dynamic_lighting)
dynamic_lighting = TRUE
shadower?.color = initial(shadower.color)
lighting_build_overlay()
else
dynamic_lighting = FALSE
shadower?.color = "#00000032"
lighting_clear_overlay()
3 changes: 2 additions & 1 deletion code/modules/multiz/zmimic/mimic_turf.dm
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,11 @@

/turf/proc/update_mimic()
if (!(z_flags & ZM_MIMIC_BELOW))
return
return FALSE

z_queued += 1
SSzcopy.queued_turfs += src
return TRUE

/// Enables Z-mimic for a turf that didn't already have it enabled.
/turf/proc/enable_zmimic(additional_flags = 0)
Expand Down