diff --git a/code/__DEFINES/objects/objects.dm b/code/__DEFINES/objects/objects.dm index 5a0c9709e8b7..65cdac7abb35 100644 --- a/code/__DEFINES/objects/objects.dm +++ b/code/__DEFINES/objects/objects.dm @@ -13,13 +13,13 @@ #define OBJ_UNDERFLOOR_ALWAYS "always" /// automatic /// -/// * gets set to UNDERFLOOR_NONE if we were made while the floor is intact +/// * gets set to UNDERFLOOR_NEVER if we were made while the floor is intact /// * gets set to UNDERFLOOR_ALWAYS if we were made while the floor isn't intact -#define OBJ_UNDERFLOOR_IF_COVERED "initially-covered" +#define OBJ_UNDERFLOOR_IF_CREATED_UNCOVERED "initially-covered" /// automatic /// -/// * DEPENDS_ON_CREATION, but always underfloor if made in mapload -#define OBJ_UNDERFLOOR_UNLESS_CREATED_ONTOP "initially-underfloor" +/// * IF_CREATED_UNCOVERED, but always underfloor if made in mapload +#define OBJ_UNDERFLOOR_UNLESS_PLACED_ONTOP "initially-underfloor" DEFINE_ENUM("obj_hides_underfloor", list( /obj = list( @@ -29,6 +29,6 @@ DEFINE_ENUM("obj_hides_underfloor", list( "Disabled" = OBJ_UNDERFLOOR_DISABLED, "Never" = OBJ_UNDERFLOOR_NEVER, "Always" = OBJ_UNDERFLOOR_ALWAYS, - "If Covered (Init Only)" = OBJ_UNDERFLOOR_IF_COVERED, - "If Created On Floor (Init Only)" = OBJ_UNDERFLOOR_UNLESS_CREATED_ONTOP, + "If Created Uncovered (Init Only)" = OBJ_UNDERFLOOR_IF_CREATED_UNCOVERED, + "If Created Uncovered Or In Mapload (Init Only)" = OBJ_UNDERFLOOR_UNLESS_PLACED_ONTOP, )) diff --git a/code/game/machinery/beacon.dm b/code/game/machinery/beacon.dm index 6f4eae330a94..0ae0529a4c7b 100644 --- a/code/game/machinery/beacon.dm +++ b/code/game/machinery/beacon.dm @@ -3,7 +3,7 @@ icon_state = "floor_beaconf" name = "Bluespace Gigabeacon" desc = "A device that draws power from bluespace and creates a permanent tracking beacon." - hides_underfloor = OBJ_UNDERFLOOR_UNLESS_CREATED_ONTOP + hides_underfloor = OBJ_UNDERFLOOR_UNLESS_PLACED_ONTOP hides_underfloor_update_icon = TRUE layer = UNDER_JUNK_LAYER anchored = TRUE diff --git a/code/game/machinery/magnet.dm b/code/game/machinery/magnet.dm index 26fe2224563b..00c9426b463c 100644 --- a/code/game/machinery/magnet.dm +++ b/code/game/machinery/magnet.dm @@ -13,7 +13,7 @@ anchored = TRUE use_power = USE_POWER_IDLE idle_power_usage = 50 - hides_underfloor = OBJ_UNDERFLOOR_UNLESS_CREATED_ONTOP + hides_underfloor = OBJ_UNDERFLOOR_UNLESS_PLACED_ONTOP hides_underfloor_update_icon = TRUE /// Radio frequency. diff --git a/code/game/machinery/navbeacon.dm b/code/game/machinery/navbeacon.dm index a889e28216b4..2f46990e8c84 100644 --- a/code/game/machinery/navbeacon.dm +++ b/code/game/machinery/navbeacon.dm @@ -9,7 +9,7 @@ var/global/list/navbeacons = list() // no I don't like putting this in, but it w name = "navigation beacon" desc = "A beacon used for bot navigation." plane = TURF_PLANE - hides_underfloor = OBJ_UNDERFLOOR_UNLESS_CREATED_ONTOP + hides_underfloor = OBJ_UNDERFLOOR_UNLESS_PLACED_ONTOP hides_underfloor_update_icon = TRUE anchored = TRUE /// TRUE if cover is open. diff --git a/code/game/objects/items/devices/radio/beacon.dm b/code/game/objects/items/devices/radio/beacon.dm index 9fca2ae5cf86..6c69a0934cd1 100644 --- a/code/game/objects/items/devices/radio/beacon.dm +++ b/code/game/objects/items/devices/radio/beacon.dm @@ -45,7 +45,7 @@ GLOBAL_LIST_BOILERPLATE(all_beacons, /obj/item/radio/beacon) desc = "A beacon used by a teleporter. This one appears to be bolted to the ground." anchored = TRUE w_class = WEIGHT_CLASS_HUGE - hides_underfloor = OBJ_UNDERFLOOR_UNLESS_CREATED_ONTOP + hides_underfloor = OBJ_UNDERFLOOR_UNLESS_PLACED_ONTOP var/repair_fail_chance = 35 diff --git a/code/game/objects/objs.dm b/code/game/objects/objs.dm index 8f7c4d2d45a1..85d27e1f4e04 100644 --- a/code/game/objects/objs.dm +++ b/code/game/objects/objs.dm @@ -908,7 +908,7 @@ */ /obj/proc/set_hides_underfloor(new_value, mapload) switch(new_value) - if(OBJ_UNDERFLOOR_IF_COVERED, OBJ_UNDERFLOOR_UNLESS_CREATED_ONTOP) + if(OBJ_UNDERFLOOR_IF_CREATED_UNCOVERED, OBJ_UNDERFLOOR_UNLESS_PLACED_ONTOP) var/turf/where_we_are = loc if(istype(where_we_are) && where_we_are.hides_underfloor_objects()) new_value = OBJ_UNDERFLOOR_ALWAYS @@ -946,15 +946,19 @@ /** * called at init + * + * todo: should this be called from obj init? we can probably shave a few centiseconds off init if it was on turf + * as we wouldn't need to keep calling hides_underfloor_objects() */ /obj/proc/initialize_hiding_underfloor(mapload) switch(hides_underfloor) - if(OBJ_UNDERFLOOR_IF_COVERED, OBJ_UNDERFLOOR_UNLESS_CREATED_ONTOP) + if(OBJ_UNDERFLOOR_IF_CREATED_UNCOVERED, OBJ_UNDERFLOOR_UNLESS_PLACED_ONTOP) var/turf/where_we_are = loc - var/hide_anyways = (hides_underfloor == OBJ_UNDERFLOOR_UNLESS_CREATED_ONTOP) && mapload - if(istype(where_we_are) && (hide_anyways || where_we_are.hides_underfloor_objects())) + var/hide_anyways = (hides_underfloor == OBJ_UNDERFLOOR_UNLESS_PLACED_ONTOP) && mapload + var/we_are_hidden = where_we_are?.hides_underfloor_objects() + if(istype(where_we_are) && (hide_anyways || !we_are_hidden)) hides_underfloor = OBJ_UNDERFLOOR_ALWAYS - if(!mapload) + if(!mapload && we_are_hidden) update_hiding_underfloor(TRUE) else hides_underfloor = OBJ_UNDERFLOOR_NEVER diff --git a/code/game/objects/structures/safe.dm b/code/game/objects/structures/safe.dm index bd806f04746a..f171fb7bfba4 100644 --- a/code/game/objects/structures/safe.dm +++ b/code/game/objects/structures/safe.dm @@ -171,7 +171,7 @@ FLOOR SAFES density = 0 plane = TURF_PLANE layer = BELOW_TURF_LAYER - hides_underfloor = OBJ_UNDERFLOOR_UNLESS_CREATED_ONTOP + hides_underfloor = OBJ_UNDERFLOOR_UNLESS_PLACED_ONTOP /obj/structure/safe/floor/Initialize(mapload) . = ..() diff --git a/code/modules/atmospherics/machinery/machinery.dm b/code/modules/atmospherics/machinery/machinery.dm index ca15e774e69b..c67fe6812b97 100644 --- a/code/modules/atmospherics/machinery/machinery.dm +++ b/code/modules/atmospherics/machinery/machinery.dm @@ -22,7 +22,7 @@ Pipelines + Other Objects -> Pipe network atom_colouration_system = FALSE climb_allowed = FALSE depth_projected = FALSE - hides_underfloor = OBJ_UNDERFLOOR_UNLESS_CREATED_ONTOP + hides_underfloor = OBJ_UNDERFLOOR_UNLESS_PLACED_ONTOP hides_underfloor_defaulting = FALSE //* Underfloor *// diff --git a/code/modules/atmospherics/machinery/pipes/pipe_base.dm b/code/modules/atmospherics/machinery/pipes/pipe_base.dm index d3b4f438ab15..567eb413c0dd 100644 --- a/code/modules/atmospherics/machinery/pipes/pipe_base.dm +++ b/code/modules/atmospherics/machinery/pipes/pipe_base.dm @@ -25,7 +25,7 @@ /obj/machinery/atmospherics/pipe/Initialize(mapload, newdir) // pipes are always underfloor if inside a wall // we just check for loc.density 'cause speed lmao - if(loc.density) + if(loc?.density) hides_underfloor = OBJ_UNDERFLOOR_ALWAYS return ..() diff --git a/code/modules/atmospherics/machinery/pipes/tank.dm b/code/modules/atmospherics/machinery/pipes/tank.dm index abed0d867283..9aae3876d549 100644 --- a/code/modules/atmospherics/machinery/pipes/tank.dm +++ b/code/modules/atmospherics/machinery/pipes/tank.dm @@ -16,6 +16,7 @@ pipe_flags = PIPING_DEFAULT_LAYER_ONLY density = TRUE hides_underfloor_underlays = TRUE + hides_underfloor_defaulting = FALSE var/start_pressure = 75*ONE_ATMOSPHERE diff --git a/code/modules/shieldgen/shield_diffuser.dm b/code/modules/shieldgen/shield_diffuser.dm index eae73e2ff688..c3b2636463e6 100644 --- a/code/modules/shieldgen/shield_diffuser.dm +++ b/code/modules/shieldgen/shield_diffuser.dm @@ -10,7 +10,7 @@ active_power_usage = 500 // Previously 2000 anchored = TRUE density = FALSE - hides_underfloor = OBJ_UNDERFLOOR_UNLESS_CREATED_ONTOP + hides_underfloor = OBJ_UNDERFLOOR_UNLESS_PLACED_ONTOP hides_underfloor_update_icon = TRUE var/alarm = FALSE var/enabled = TRUE