mirror of
https://github.com/SpaceManiac/SpacemanDMM.git
synced 2025-12-23 05:36:47 +00:00
Split fancy_layer_of into two functions
This commit is contained in:
parent
b7598f73ff
commit
6f79a55b27
1 changed files with 10 additions and 4 deletions
|
|
@ -554,8 +554,14 @@ pub fn color_of<T: GetVar + ?Sized>(objtree: &ObjectTree, atom: &T) -> [u8; 4] {
|
|||
}
|
||||
|
||||
fn fancy_layer_of<T: GetVar + ?Sized>(objtree: &ObjectTree, atom: &T) -> i32 {
|
||||
let p = atom.get_path();
|
||||
if subtype(p, "/turf/open/floor/plating/") || subtype(p, "/turf/open/space/") {
|
||||
match fancy_layer_for_path(atom.get_path()) {
|
||||
Some(layer) => layer,
|
||||
None => layer_of(objtree, atom),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn fancy_layer_for_path(p: &str) -> Option<i32> {
|
||||
Some(if subtype(p, "/turf/open/floor/plating/") || subtype(p, "/turf/open/space/") {
|
||||
-10_000 // under everything
|
||||
} else if subtype(p, "/turf/closed/mineral/") {
|
||||
-3_000 // above hidden stuff and plating but below walls
|
||||
|
|
@ -578,8 +584,8 @@ fn fancy_layer_of<T: GetVar + ?Sized>(objtree: &ObjectTree, atom: &T) -> i32 {
|
|||
} else if subtype(p, "/obj/machinery/navbeacon/") {
|
||||
-3_000
|
||||
} else {
|
||||
layer_of(objtree, atom)
|
||||
}
|
||||
return None
|
||||
})
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue