Skip to content

Commit

Permalink
Flattens The Floor Plane (Camera Update Too) (tgstation#84350)
Browse files Browse the repository at this point in the history
## About The Pull Request

Ok so like, side map right? It makes things higher up in the world
render above things lower down in the world.

Most of the time this is what we want, but it is NOT what we want for
floors.
Floors are allowed to be larger then 32x32, and if they are we want them
to render based off JUST their layer.
If we don't allow this grass turfs and others get cut off on their
bottom edge, which looks WEIRD.

In order to make this happen, we can add TOPDOWN_LAYER to every layer on
the floor plane and disable sidemap.

I've added documentation for this to VISUALS.md, and have also
implemented unit test errors to prevent mixing TOPDOWN layers with non
topdown planes (or vis versa).
This new test adds ~1 second to tests, which is I think a perfectly
scrumpulent number.

EDIT:

I nerd sniped myself and implemented sidemap layering and lighting for
cameras (also larger then 32x32 icon support for getflat)
The lighting isn't perfect, we don't handle things displaying in the
void all that well (I am convinced getflat blending is broken but I have
no debugger so I can't fix it properly), but it'll do.

This came up cause I had to fix another layering issue in cameras and
thought I might as well go all in.

![image](https://github.com/tgstation/tgstation/assets/58055496/601b422c-f6aa-42ba-bcd9-b1faebe236e3)


## Why It's Good For The Game

Old:

![image](https://github.com/tgstation/tgstation/assets/58055496/d4102386-420d-4346-b05c-b819e62d98d0)

New:

![image](https://github.com/tgstation/tgstation/assets/58055496/1f5e303e-adee-427d-8fe3-76c8f2dbe098)


## Changelog
:cl:
fix: Grass turfs will render properly now. Reworked how floors render,
please report any bugs!
fix: Cameras now properly capture lighting
fix: The layering seen in photos should better match the actual game
/:cl:
  • Loading branch information
LemonInTheDark authored Jul 4, 2024
1 parent c198fad commit e90a9b4
Show file tree
Hide file tree
Showing 54 changed files with 203 additions and 88 deletions.
3 changes: 3 additions & 0 deletions .github/guides/VISUALS.md
Original file line number Diff line number Diff line change
Expand Up @@ -406,6 +406,9 @@ There are a few snowflake layers that can be used to accomplish niche goals, alo

Floating layers will float "up" the chain of things they're being drawn onto, until they find a real layer. They'll then offset off of that.

Adding `TOPDOWN_LAYER` (actual value `10000`) to another layer forces the appearance into topdown rendering, locally disabling [side map](#side_map-check-the-main-page-too).
We can think of this as applying to planes, since we don't want it interlaying with other non topdown objects.

This allows us to keep relative layer differences while not needing to make all sources static. Often very useful.

## Planes
Expand Down
42 changes: 27 additions & 15 deletions code/__DEFINES/layers.dm
Original file line number Diff line number Diff line change
Expand Up @@ -122,23 +122,37 @@
// PLANE_SPACE layer(s)
#define SPACE_LAYER 1.8

//#define TURF_LAYER 2 //For easy recordkeeping; this is a byond define. Most floors (FLOOR_PLANE) and walls (WALL_PLANE) use this.
// placed here for documentation. Byond's default turf layer
// We do not use it, as different turfs render on different planes
// #define TURF_LAYER 2
#define TURF_LAYER 2 #error TURF_LAYER is no longer supported, please be more specific

// FLOOR_PLANE layer(s)
// We need to force this plane to render as if we were not using sidemap
// this allows larger then bound floors to layer as we'd expect
// ANYTHING on the floor plane needs TOPDOWN_LAYER, and nothing that isn't on the floor plane can have it

//FLOOR_PLANE layers
#define TURF_PLATING_DECAL_LAYER 2.001
#define TURF_DECAL_LAYER 2.009 //Makes turf decals appear in DM how they will look inworld.
#define CULT_OVERLAY_LAYER 2.01
#define MID_TURF_LAYER 2.02
#define HIGH_TURF_LAYER 2.03
#define LATTICE_LAYER 2.04
#define DISPOSAL_PIPE_LAYER 2.042
#define WIRE_LAYER 2.044
#define GLASS_FLOOR_LAYER 2.046
#define TRAM_RAIL_LAYER 2.047
#define ABOVE_OPEN_TURF_LAYER 2.049
// NOTICE: we break from the pattern of increasing in steps of like 0.01 here
// Because TOPDOWN_LAYER is 10000 and that's enough to floating point our modifications away
#define LOW_FLOOR_LAYER (1 + TOPDOWN_LAYER)
#define TURF_PLATING_DECAL_LAYER (2 + TOPDOWN_LAYER)
#define TURF_DECAL_LAYER (3 + TOPDOWN_LAYER) //Makes turf decals appear in DM how they will look inworld.
#define CULT_OVERLAY_LAYER (4 + TOPDOWN_LAYER)
#define MID_TURF_LAYER (5 + TOPDOWN_LAYER)
#define HIGH_TURF_LAYER (6 + TOPDOWN_LAYER)
#define LATTICE_LAYER (7 + TOPDOWN_LAYER)
#define DISPOSAL_PIPE_LAYER (8 + TOPDOWN_LAYER)
#define WIRE_LAYER (9 + TOPDOWN_LAYER)
#define GLASS_FLOOR_LAYER (10 + TOPDOWN_LAYER)
#define TRAM_RAIL_LAYER (11 + TOPDOWN_LAYER)
///catwalk overlay of /turf/open/floor/plating/catwalk_floor
#define CATWALK_LAYER (12 + TOPDOWN_LAYER)
#define ABOVE_OPEN_TURF_LAYER (13 + TOPDOWN_LAYER)

//WALL_PLANE layers
#define CLOSED_TURF_LAYER 2.05
#define BELOW_CLOSED_TURF_LAYER 2.053
#define CLOSED_TURF_LAYER 2.058

// GAME_PLANE layers
#define BULLET_HOLE_LAYER 2.06
Expand All @@ -153,8 +167,6 @@
#define PLUMBING_PIPE_VISIBILE_LAYER 2.495//layer = initial(layer) + ducting_layer / 3333 in atmospherics/handle_layer() to determine order of duct overlap
#define BOT_PATH_LAYER 2.497
#define LOW_OBJ_LAYER 2.5
///catwalk overlay of /turf/open/floor/plating/catwalk_floor
#define CATWALK_LAYER 2.51
#define LOW_SIGIL_LAYER 2.52
#define SIGIL_LAYER 2.53
#define HIGH_PIPE_LAYER 2.54
Expand Down
16 changes: 16 additions & 0 deletions code/__HELPERS/_planes.dm
Original file line number Diff line number Diff line change
Expand Up @@ -86,3 +86,19 @@
// This is solvable with lowspec preferences, which would not be hard to implement
// Player popups will now render their effects, like overlay lights. this is fixable, but I've not gotten to it
// I think overlay lights can render on the wrong z layer. s fucked

/// Whitelist of planes allowed to use TOPDOWN_LAYER
GLOBAL_LIST_INIT(topdown_planes, list(
"[FLOOR_PLANE]" = TRUE,
))

/// Checks if a passed in MA or atom is allowed to have its current plane/layer matchup
/proc/check_topdown_validity(mutable_appearance/thing_to_check)
if(istype(thing_to_check, /atom/movable/screen/plane_master))
return
var/topdown_plane = GLOB.topdown_planes["[PLANE_TO_TRUE(thing_to_check.plane)]"]
if(topdown_plane)
if(thing_to_check.layer - TOPDOWN_LAYER < 0 || thing_to_check.layer >= BACKGROUND_LAYER)
stack_trace("[thing_to_check] ([thing_to_check.type]) was expected to have a TOPDOWN_LAYER layer due to its plane, but it DID NOT! layer: ([thing_to_check.layer]) plane: ([thing_to_check.plane])")
else if(thing_to_check.layer - TOPDOWN_LAYER >= 0 && thing_to_check.layer < BACKGROUND_LAYER)
stack_trace("[thing_to_check] ([thing_to_check.type] is NOT ALLOWED to have a TOPDOWN_LAYER layer due to its plane, but it did! layer: ([thing_to_check.layer]) plane: ([thing_to_check.plane])")
2 changes: 1 addition & 1 deletion code/__HELPERS/icon_smoothing.dm
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,7 @@ xxx xxx xxx
var/junction_dir = reverse_ndir(smoothing_junction)
var/turned_adjacency = REVERSE_DIR(junction_dir)
var/turf/neighbor_turf = get_step(src, turned_adjacency & (NORTH|SOUTH))
var/mutable_appearance/underlay_appearance = mutable_appearance(layer = TURF_LAYER, offset_spokesman = src, plane = FLOOR_PLANE)
var/mutable_appearance/underlay_appearance = mutable_appearance(layer = LOW_FLOOR_LAYER, offset_spokesman = src, plane = FLOOR_PLANE)
if(!neighbor_turf.get_smooth_underlay_icon(underlay_appearance, src, turned_adjacency))
neighbor_turf = get_step(src, turned_adjacency & (EAST|WEST))

Expand Down
14 changes: 12 additions & 2 deletions code/__HELPERS/icons.dm
Original file line number Diff line number Diff line change
Expand Up @@ -420,6 +420,10 @@ world
} \
current_layer = base_layer + appearance.layer + current_layer / 1000; \
} \
/* If we are using topdown rendering, chop that part off so things layer together as expected */ \
if((current_layer >= TOPDOWN_LAYER && current_layer < EFFECTS_LAYER) || current_layer > TOPDOWN_LAYER + EFFECTS_LAYER) { \
current_layer -= TOPDOWN_LAYER; \
} \
for (var/index_to_compare_to in 1 to layers.len) { \
var/compare_to = layers[index_to_compare_to]; \
if (current_layer < layers[compare_to]) { \
Expand All @@ -431,9 +435,10 @@ world
}

var/static/icon/flat_template = icon('icons/blanks/32x32.dmi', "nothing")
var/icon/flat = icon(flat_template)

if(!appearance || appearance.alpha <= 0)
return icon(flat_template)
return flat

if(start)
if(!defdir)
Expand Down Expand Up @@ -474,10 +479,15 @@ world
if(!base_icon_dir)
base_icon_dir = curdir

// Expand our canvas to fit if we're too big
if(render_icon)
var/icon/active_icon = icon(curicon)
if(active_icon.Width() != 32 || active_icon.Height() != 32)
flat.Scale(active_icon.Width(), active_icon.Height())

var/curblend = appearance.blend_mode || defblend

if(appearance.overlays.len || appearance.underlays.len)
var/icon/flat = icon(flat_template)
// Layers will be a sorted list of icons/overlays, based on the order in which they are displayed
var/list/layers = list()
var/image/copy
Expand Down
1 change: 1 addition & 0 deletions code/_onclick/hud/picture_in_picture.dm
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/atom/movable/screen/movable/pic_in_pic
name = "Picture-in-picture"
screen_loc = "CENTER"
layer = ABOVE_OPEN_TURF_LAYER
plane = FLOOR_PLANE
var/atom/center
var/width = 0
Expand Down
10 changes: 5 additions & 5 deletions code/datums/elements/turf_transparency.dm
Original file line number Diff line number Diff line change
Expand Up @@ -219,10 +219,10 @@ GLOBAL_LIST_EMPTY(pillars_by_z)
// it will make them look significantly nicer, and should let you tie into their logic more easily
// Just please don't break behavior yeah? thanks, I love you <3
if(isclosedturf(our_turf)) //Show girders below closed turfs
var/mutable_appearance/girder_underlay = mutable_appearance('icons/obj/structures.dmi', "girder", layer = TURF_LAYER-0.01)
var/mutable_appearance/girder_underlay = mutable_appearance('icons/obj/structures.dmi', "girder", layer = BELOW_CLOSED_TURF_LAYER)
girder_underlay.appearance_flags = RESET_ALPHA | RESET_COLOR
our_turf.underlays += girder_underlay
var/mutable_appearance/plating_underlay = mutable_appearance('icons/turf/floors.dmi', "plating", layer = TURF_LAYER-0.02)
var/mutable_appearance/plating_underlay = mutable_appearance('icons/turf/floors.dmi', "plating", layer = LOW_FLOOR_LAYER, offset_spokesman = our_turf, plane = FLOOR_PLANE)
plating_underlay.appearance_flags = RESET_ALPHA | RESET_COLOR
our_turf.underlays += plating_underlay
return TRUE
Expand All @@ -240,10 +240,10 @@ GLOBAL_LIST_EMPTY(pillars_by_z)
our_turf.underlays -= get_baseturf_underlay(our_turf)

if(isclosedturf(our_turf)) //Show girders below closed turfs
var/mutable_appearance/girder_underlay = mutable_appearance('icons/obj/structures.dmi', "girder", layer = TURF_LAYER-0.01)
var/mutable_appearance/girder_underlay = mutable_appearance('icons/obj/structures.dmi', "girder", layer = BELOW_CLOSED_TURF_LAYER)
girder_underlay.appearance_flags = RESET_ALPHA | RESET_COLOR
our_turf.underlays -= girder_underlay
var/mutable_appearance/plating_underlay = mutable_appearance('icons/turf/floors.dmi', "plating", layer = TURF_LAYER-0.02)
var/mutable_appearance/plating_underlay = mutable_appearance('icons/turf/floors.dmi', "plating", layer = LOW_FLOOR_LAYER, offset_spokesman = our_turf, plane = FLOOR_PLANE)
plating_underlay.appearance_flags = RESET_ALPHA | RESET_COLOR
our_turf.underlays -= plating_underlay

Expand Down Expand Up @@ -271,7 +271,7 @@ GLOBAL_LIST_EMPTY(pillars_by_z)
if(!ispath(path))
warning("Z-level [our_turf.z] has invalid baseturf '[SSmapping.level_trait(our_turf.z, ZTRAIT_BASETURF)]'")
path = /turf/open/space
var/mutable_appearance/underlay_appearance = mutable_appearance(initial(path.icon), initial(path.icon_state), layer = TURF_LAYER-0.02, offset_spokesman = our_turf, plane = PLANE_SPACE)
var/mutable_appearance/underlay_appearance = mutable_appearance(initial(path.icon), initial(path.icon_state), layer = SPACE_LAYER + 0.1, offset_spokesman = our_turf, plane = PLANE_SPACE)
underlay_appearance.appearance_flags = RESET_ALPHA | RESET_COLOR
return underlay_appearance

Expand Down
2 changes: 2 additions & 0 deletions code/datums/elements/undertile.dm
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@

if(underfloor_accessibility < UNDERFLOOR_INTERACTABLE)
SET_PLANE_IMPLICIT(source, FLOOR_PLANE) // We do this so that turfs that allow you to see what's underneath them don't have to be on the game plane (which causes ambient occlusion weirdness)
source.layer = ABOVE_OPEN_TURF_LAYER
ADD_TRAIT(source, TRAIT_UNDERFLOOR, REF(src))

if(tile_overlay)
Expand All @@ -61,6 +62,7 @@

else
SET_PLANE_IMPLICIT(source, initial(source.plane))
source.layer = initial(source.layer)
REMOVE_TRAIT(source, TRAIT_UNDERFLOOR, REF(src))

if(invisibility_trait)
Expand Down
3 changes: 3 additions & 0 deletions code/datums/mutable_appearance.dm
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,7 @@
else if(!isnull(offset_spokesman) && !isatom(offset_spokesman))
stack_trace("Why did you pass in offset_spokesman as [offset_spokesman]? We need an atom to properly offset planes")

if(PERFORM_ALL_TESTS(focus_only/topdown_filtering))
check_topdown_validity(appearance)

return appearance
2 changes: 1 addition & 1 deletion code/datums/weather/weather.dm
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
/// The list of z-levels that this weather is actively affecting
var/impacted_z_levels

/// Since it's above everything else, this is the layer used by default. TURF_LAYER is below mobs and walls if you need to use that.
/// Since it's above everything else, this is the layer used by default.
var/overlay_layer = AREA_LAYER
/// Plane for the overlay
var/overlay_plane = AREA_PLANE
Expand Down
2 changes: 1 addition & 1 deletion code/game/atom/_atom.dm
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* as much as possible to the components/elements system
*/
/atom
layer = TURF_LAYER
layer = ABOVE_NORMAL_TURF_LAYER
plane = GAME_PLANE
appearance_flags = TILE_BOUND|LONG_GLIDE

Expand Down
2 changes: 1 addition & 1 deletion code/game/machinery/ai_slipper.dm
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
icon = 'icons/obj/devices/tool.dmi'
icon_state = "ai-slipper0"
base_icon_state = "ai-slipper"
layer = PROJECTILE_HIT_THRESHHOLD_LAYER
layer = ABOVE_OPEN_TURF_LAYER
plane = FLOOR_PLANE
max_integrity = 200
armor_type = /datum/armor/machinery_ai_slipper
Expand Down
7 changes: 2 additions & 5 deletions code/game/machinery/hologram.dm
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ Possible to do for anyone motivated enough:
icon = 'icons/obj/machines/floor.dmi'
icon_state = "holopad0"
base_icon_state = "holopad"
layer = LOW_OBJ_LAYER
/// The plane is set such that it shows up without being covered by pipes/wires in a map editor, we change this on initialize.
plane = GAME_PLANE
layer = MAP_SWITCH(ABOVE_OPEN_TURF_LAYER, LOW_OBJ_LAYER)
plane = MAP_SWITCH(FLOOR_PLANE, GAME_PLANE)
req_access = list(ACCESS_KEYCARD_AUTH) //Used to allow for forced connecting to other (not secure) holopads. Anyone can make a call, though.
max_integrity = 300
armor_type = /datum/armor/machinery_holopad
Expand Down Expand Up @@ -101,9 +101,6 @@ Possible to do for anyone motivated enough:

/obj/machinery/holopad/Initialize(mapload)
. = ..()
/// We set the plane on mapload such that we can see the holopad render over atmospherics pipe and cabling in a map editor (without initialization), but so it gets that "inset" look in the floor in-game.
SET_PLANE_IMPLICIT(src, FLOOR_PLANE)
update_appearance()

var/static/list/hovering_mob_typechecks = list(
/mob/living/silicon = list(
Expand Down
1 change: 1 addition & 0 deletions code/game/machinery/igniter.dm
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
icon = 'icons/obj/machines/floor.dmi'
icon_state = "igniter0"
base_icon_state = "igniter"
layer = ABOVE_OPEN_TURF_LAYER
plane = FLOOR_PLANE
max_integrity = 300
armor_type = /datum/armor/machinery_igniter
Expand Down
2 changes: 1 addition & 1 deletion code/game/machinery/launch_pad.dm
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@
/// Updates diagnostic huds
/obj/machinery/launchpad/proc/update_hud()
var/image/holder = hud_list[DIAG_LAUNCHPAD_HUD]
var/mutable_appearance/target = mutable_appearance('icons/effects/effects.dmi', "launchpad_target", ABOVE_OPEN_TURF_LAYER, src, GAME_PLANE)
var/mutable_appearance/target = mutable_appearance('icons/effects/effects.dmi', "launchpad_target", ABOVE_NORMAL_TURF_LAYER, src, GAME_PLANE)
holder.appearance = target

update_indicator()
Expand Down
2 changes: 1 addition & 1 deletion code/game/objects/effects/blessing.dm
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
for(var/obj/effect/blessing/B in loc)
if(B != src)
return INITIALIZE_HINT_QDEL
var/image/I = image(icon = 'icons/effects/effects.dmi', icon_state = "blessed", layer = ABOVE_OPEN_TURF_LAYER, loc = src)
var/image/I = image(icon = 'icons/effects/effects.dmi', icon_state = "blessed", layer = ABOVE_NORMAL_TURF_LAYER, loc = src)
I.alpha = 64
I.appearance_flags = RESET_ALPHA
add_alt_appearance(/datum/atom_hud/alternate_appearance/basic/blessed_aware, "blessing", I)
Expand Down
1 change: 1 addition & 0 deletions code/game/objects/effects/decals/cleanable.dm
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/obj/effect/decal/cleanable
gender = PLURAL
plane = GAME_PLANE
layer = FLOOR_CLEAN_LAYER
var/list/random_icon_states = null
///I'm sorry but cleanable/blood code is ass, and so is blood_DNA
Expand Down
1 change: 1 addition & 0 deletions code/game/objects/effects/decals/decal.dm
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/obj/effect/decal
name = "decal"
layer = ABOVE_OPEN_TURF_LAYER
plane = FLOOR_PLANE
anchored = TRUE
resistance_flags = FIRE_PROOF | UNACIDABLE | ACID_PROOF
Expand Down
1 change: 1 addition & 0 deletions code/game/objects/effects/temporary_visuals/cult.dm
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
/obj/effect/temp_visual/cult/turf/floor
icon_state = "floorglow"
duration = 5
layer = ABOVE_OPEN_TURF_LAYER
plane = FLOOR_PLANE

/obj/effect/temp_visual/cult/portal
Expand Down
1 change: 1 addition & 0 deletions code/game/objects/items/devices/flashlight.dm
Original file line number Diff line number Diff line change
Expand Up @@ -928,6 +928,7 @@
light_range = 4
light_power = 2
alpha = 0
layer = ABOVE_OPEN_TURF_LAYER
plane = FLOOR_PLANE
anchored = TRUE
resistance_flags = INDESTRUCTIBLE | LAVA_PROOF | FIRE_PROOF | UNACIDABLE | ACID_PROOF
Expand Down
1 change: 1 addition & 0 deletions code/game/objects/items/puzzle_pieces.dm
Original file line number Diff line number Diff line change
Expand Up @@ -558,6 +558,7 @@ MAPPING_DIRECTIONAL_HELPERS(/obj/machinery/puzzle/password/pin, 32)
desc = "A board filled with colored dots. What could this mean?"
icon = 'icons/obj/fluff/puzzle_small.dmi'
icon_state = "puzzle_dots"
layer = ABOVE_NORMAL_TURF_LAYER
plane = GAME_PLANE //visible over walls
resistance_flags = INDESTRUCTIBLE | FIRE_PROOF | UNACIDABLE | LAVA_PROOF
flags_1 = UNPAINTABLE_1
Expand Down
1 change: 1 addition & 0 deletions code/game/objects/structures/fake_stairs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
anchored = TRUE
move_resist = INFINITY

layer = ABOVE_OPEN_TURF_LAYER
plane = FLOOR_PLANE //one with the floor

MAPPING_DIRECTIONAL_HELPERS(/obj/structure/fake_stairs, 0)
Expand Down
2 changes: 1 addition & 1 deletion code/game/objects/structures/fluff.dm
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
icon = 'icons/obj/mining_zones/survival_pod.dmi'
icon_state = "fan_tiny"
plane = FLOOR_PLANE
layer = LOW_OBJ_LAYER
layer = ABOVE_OPEN_TURF_LAYER

/**
* A variety of statue in disrepair; parts are broken off and a gemstone is missing
Expand Down
2 changes: 1 addition & 1 deletion code/game/turfs/closed/walls.dm
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@
if(is_station_level(z))
GLOB.station_turfs += src
if(smoothing_flags & SMOOTH_DIAGONAL_CORNERS && fixed_underlay) //Set underlays for the diagonal walls.
var/mutable_appearance/underlay_appearance = mutable_appearance(layer = TURF_LAYER, offset_spokesman = src, plane = FLOOR_PLANE)
var/mutable_appearance/underlay_appearance = mutable_appearance(layer = LOW_FLOOR_LAYER, offset_spokesman = src, plane = FLOOR_PLANE)
if(fixed_underlay["space"])
generate_space_underlay(underlay_appearance, src)
else
Expand Down
1 change: 1 addition & 0 deletions code/game/turfs/open/_open.dm
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/turf/open
layer = LOW_FLOOR_LAYER
plane = FLOOR_PLANE
///negative for faster, positive for slower
var/slowdown = 0
Expand Down
8 changes: 2 additions & 6 deletions code/game/turfs/open/floor/catwalk_plating.dm
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,10 @@
rust_resistance = RUST_RESISTANCE_BASIC
var/covered = TRUE
var/catwalk_type = "maint"
var/static/list/catwalk_underlays = list()

/turf/open/floor/catwalk_floor/Initialize(mapload)
. = ..()
if(!catwalk_underlays[catwalk_type])
var/mutable_appearance/plating_underlay = mutable_appearance(icon, "[catwalk_type]_below", TURF_LAYER)
catwalk_underlays[catwalk_type] = plating_underlay
underlays += catwalk_underlays[catwalk_type]
underlays += mutable_appearance(icon, "[catwalk_type]_below", LOW_FLOOR_LAYER, src, FLOOR_PLANE)
update_appearance()

/turf/open/floor/catwalk_floor/examine(mob/user)
Expand All @@ -43,7 +39,7 @@
covered = !covered
if(!covered)
underfloor_accessibility = UNDERFLOOR_INTERACTABLE
layer = TURF_LAYER
layer = LOW_FLOOR_LAYER
icon_state = "[catwalk_type]_below"
else
underfloor_accessibility = UNDERFLOOR_VISIBLE
Expand Down
1 change: 1 addition & 0 deletions code/game/turfs/open/floor/fancy_floor.dm
Original file line number Diff line number Diff line change
Expand Up @@ -871,6 +871,7 @@
icon = 'icons/turf/space.dmi'
icon_state = "space"
floor_tile = /obj/item/stack/tile/fakespace
layer = SPACE_LAYER
plane = PLANE_SPACE
tiled_dirt = FALSE
damaged_dmi = 'icons/turf/space.dmi'
Expand Down
1 change: 1 addition & 0 deletions code/game/turfs/open/openspace.dm
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
mouse_opacity = MOUSE_OPACITY_TRANSPARENT
pathing_pass_method = TURF_PATHING_PASS_PROC
plane = TRANSPARENT_FLOOR_PLANE
layer = SPACE_LAYER
rust_resistance = RUST_RESISTANCE_ABSOLUTE
var/can_cover_up = TRUE
var/can_build_on = TRUE
Expand Down
Loading

0 comments on commit e90a9b4

Please sign in to comment.