diff --git a/code/__DEFINES/is_helpers.dm b/code/__DEFINES/is_helpers.dm index ba467347e87..0d9d28d4d85 100644 --- a/code/__DEFINES/is_helpers.dm +++ b/code/__DEFINES/is_helpers.dm @@ -49,6 +49,8 @@ GLOBAL_LIST_INIT(turfs_openspace, typecacheof(list( #define isspaceturf(A) (istype(A, /turf/open/space)) +#define is_space_or_openspace(A) (isopenspaceturf(A) || isspaceturf(A)) + #define isfloorturf(A) (istype(A, /turf/open/floor)) #define ismiscturf(A) (istype(A, /turf/open/misc)) diff --git a/code/datums/ai/basic_mobs/basic_subtrees/go_for_swim.dm b/code/datums/ai/basic_mobs/basic_subtrees/go_for_swim.dm index 12c77119f3e..e6427455c4e 100644 --- a/code/datums/ai/basic_mobs/basic_subtrees/go_for_swim.dm +++ b/code/datums/ai/basic_mobs/basic_subtrees/go_for_swim.dm @@ -35,7 +35,7 @@ var/look_for_land = controller.blackboard[BB_CURRENTLY_SWIMMING] var/list/possible_turfs = list() for(var/turf/possible_turf in oview(search_range, living_pawn)) - if(isclosedturf(possible_turf) || isspaceturf(possible_turf) || isopenspaceturf(possible_turf)) + if(isclosedturf(possible_turf) || is_space_or_openspace(possible_turf)) continue if(possible_turf.is_blocked_turf()) continue diff --git a/code/datums/components/riding/riding_vehicle.dm b/code/datums/components/riding/riding_vehicle.dm index 68e44c4acd3..561d0c87218 100644 --- a/code/datums/components/riding/riding_vehicle.dm +++ b/code/datums/components/riding/riding_vehicle.dm @@ -242,12 +242,12 @@ ///Makes sure that the hoverboard can move in zero-g in (open) space but only there's a ground turf on the z-level below. /datum/component/riding/vehicle/scooter/skateboard/hover/proc/hover_check(is_moving = FALSE) var/atom/movable/movable = parent - if(!isopenspaceturf(movable.loc)) + if(!is_space_or_openspace(movable.loc)) override_allow_spacemove = TRUE return var/turf/open/our_turf = movable.loc var/turf/turf_below = GET_TURF_BELOW(our_turf) - if(our_turf.zPassOut(DOWN) && (isnull(turf_below) || (isopenspaceturf(turf_below) && turf_below.zPassIn(DOWN) && turf_below.zPassOut(DOWN)))) + if(our_turf.zPassOut(DOWN) && (isnull(turf_below) || (is_space_or_openspace(turf_below) && turf_below.zPassIn(DOWN) && turf_below.zPassOut(DOWN)))) override_allow_spacemove = FALSE if(turf_below) our_turf.zFall(movable, falling_from_move = is_moving) diff --git a/code/datums/elements/floorloving.dm b/code/datums/elements/floorloving.dm index 229dea11da8..c14d9d5801e 100644 --- a/code/datums/elements/floorloving.dm +++ b/code/datums/elements/floorloving.dm @@ -14,7 +14,7 @@ /// Block movement to any non-floor location /datum/element/floor_loving/proc/attempting_move(atom/movable/parent, newloc) SIGNAL_HANDLER - if (!isopenturf(newloc) || isspaceturf(newloc) || isopenspaceturf(newloc)) + if (!isopenturf(newloc) || is_space_or_openspace(newloc)) return COMPONENT_MOVABLE_BLOCK_PRE_MOVE if (isliving(parent)) var/mob/living/living_parent = parent diff --git a/code/modules/events/space_vines/vine_structure.dm b/code/modules/events/space_vines/vine_structure.dm index 4b3a10d9256..a7b9aa2fce5 100644 --- a/code/modules/events/space_vines/vine_structure.dm +++ b/code/modules/events/space_vines/vine_structure.dm @@ -161,7 +161,7 @@ if(!istype(stepturf)) return - if(isspaceturf(stepturf) || isopenspaceturf(stepturf) || !stepturf.Enter(src)) + if(is_space_or_openspace(stepturf) || !stepturf.Enter(src)) return if(ischasm(stepturf) && !HAS_TRAIT(stepturf, TRAIT_CHASM_STOPPED)) return diff --git a/code/modules/mob/living/basic/lavaland/goliath/tentacle.dm b/code/modules/mob/living/basic/lavaland/goliath/tentacle.dm index 030ae6d64b8..ba6346ea191 100644 --- a/code/modules/mob/living/basic/lavaland/goliath/tentacle.dm +++ b/code/modules/mob/living/basic/lavaland/goliath/tentacle.dm @@ -20,7 +20,7 @@ if (ismineralturf(loc)) var/turf/closed/mineral/floor = loc floor.gets_drilled() - if (!isopenturf(loc) || isspaceturf(loc) || isopenspaceturf(loc)) + if (!isopenturf(loc) || is_space_or_openspace(loc)) return INITIALIZE_HINT_QDEL for (var/obj/effect/goliath_tentacle/tentacle in loc) if (tentacle != src) diff --git a/code/modules/mob/living/basic/pets/parrot/parrot_ai/parrot_hoarding.dm b/code/modules/mob/living/basic/pets/parrot/parrot_ai/parrot_hoarding.dm index 7484cbfe675..ad9a56b3acf 100644 --- a/code/modules/mob/living/basic/pets/parrot/parrot_ai/parrot_hoarding.dm +++ b/code/modules/mob/living/basic/pets/parrot/parrot_ai/parrot_hoarding.dm @@ -29,7 +29,7 @@ /datum/ai_behavior/find_and_set/hoard_location/search_tactic(datum/ai_controller/controller, locate_path, search_range) for(var/turf/open/candidate in oview(search_range, controller.pawn)) - if(isspaceturf(candidate) || isopenspaceturf(candidate)) + if(is_space_or_openspace(candidate)) continue if(candidate.is_blocked_turf(source_atom = controller.pawn)) continue