Fixing a couple issues with pipes rendering and the immerse element. (#87635)

## About The Pull Request
Atomizing changes from an upcoming PR. Basically the immerse element
didn't work for things on the floor plane ever since the TOPDOWN_LAYER
was introduced to the code (eg disposal pipes don't appear underwater),
and the type checks for atmos pipe caps are deprecated by the
underfloor_accessibility var.

## Why It's Good For The Game
Fixing a couple visual nits.

## Changelog

🆑
fix: Fixed a couple nits with the water visuals not appearing on objects
with a very low layer (rendered just above the floor), as well as atmos
pipes looking a bit funky on untiled turfs beside catwalks and platings
when beside connected, under-floored pipes.
/🆑
This commit is contained in:
Ghom
2024-11-20 09:09:51 +01:00
committed by GitHub
parent 2473fca3dc
commit ad74da5cd2
3 changed files with 18 additions and 4 deletions

View File

@@ -160,6 +160,13 @@
/// Basically any layer below this (numerically) is "on" a floor for the purposes of washing
#define FLOOR_CLEAN_LAYER (21 + TOPDOWN_LAYER)
//Placeholders in case the game plane and possibly other things between it and the floor plane are ever made into topdown planes
///Below this level, objects with topdown layers are rendered as if underwater by the immerse element
#define TOPDOWN_WATER_LEVEL_LAYER 100 + TOPDOWN_LAYER
///Above this level, objects with topdown layers are unaffected by the immerse element
#define TOPDOWN_ABOVE_WATER_LAYER 200 + TOPDOWN_LAYER
//WALL_PLANE layers
#define BELOW_CLOSED_TURF_LAYER 2.053
#define CLOSED_TURF_LAYER 2.058

View File

@@ -92,12 +92,13 @@ GLOBAL_LIST_INIT(topdown_planes, list(
"[FLOOR_PLANE]" = TRUE,
))
#define IS_TOPDOWN_PLANE(plane) GLOB.topdown_planes["[PLANE_TO_TRUE(plane)]"]
/// 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(IS_TOPDOWN_PLANE(thing_to_check.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)

View File

@@ -103,7 +103,11 @@ GLOBAL_LIST_INIT(immerse_ignored_movable, typecacheof(list(
return
if(HAS_TRAIT(movable, TRAIT_IMMERSED) || HAS_TRAIT(movable, TRAIT_WALLMOUNTED))
return
if(movable.layer >= ABOVE_ALL_MOB_LAYER || !ISINRANGE(movable.plane, MUTATE_PLANE(FLOOR_PLANE, source), MUTATE_PLANE(GAME_PLANE, source)))
if(!ISINRANGE(movable.plane, MUTATE_PLANE(FLOOR_PLANE, source), MUTATE_PLANE(GAME_PLANE, source)))
return
var/layer_to_check = IS_TOPDOWN_PLANE(source.plane) ? TOPDOWN_ABOVE_WATER_LAYER : ABOVE_ALL_MOB_LAYER
//First, floor plane objects use TOPDOWN_LAYER, second this check shouldn't apply to them anyway.
if(movable.layer >= layer_to_check)
return
if(is_type_in_typecache(movable, GLOB.immerse_ignored_movable))
return
@@ -137,7 +141,9 @@ GLOBAL_LIST_INIT(immerse_ignored_movable, typecacheof(list(
var/width = icon_dimensions["width"] || ICON_SIZE_X
var/height = icon_dimensions["height"] || ICON_SIZE_Y
var/is_below_water = movable.layer < WATER_LEVEL_LAYER ? "underwater-" : ""
///This determines if the overlay should cover the entire surface of the object or not
var/layer_to_check = IS_TOPDOWN_PLANE(movable.plane) ? TOPDOWN_WATER_LEVEL_LAYER : WATER_LEVEL_LAYER
var/is_below_water = (movable.layer < layer_to_check) ? "underwater-" : ""
var/atom/movable/immerse_overlay/vis_overlay = generated_visual_overlays["[is_below_water][width]x[height]"]