From 3f13fda08751e73099d3ca0292f62acfc237a00f Mon Sep 17 00:00:00 2001 From: Tim Date: Fri, 8 Apr 2022 23:38:19 -0500 Subject: [PATCH] Fix movement turf changer element to check openspace (#65757) Fixes #65472 (The movement_turf_changer element allows creatures to step onto open space and fill them in ) This adds an openspace check for the movement_turf_changer element so that whatever mob is using it will fall through openspace properly. I don't know what a moonicorn is but it sounds cool. --- code/__DEFINES/is_helpers.dm | 15 ++++++++++----- code/datums/elements/movement_turf_changer.dm | 2 +- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/code/__DEFINES/is_helpers.dm b/code/__DEFINES/is_helpers.dm index c5e00a71642..f0da816ef2b 100644 --- a/code/__DEFINES/is_helpers.dm +++ b/code/__DEFINES/is_helpers.dm @@ -19,11 +19,19 @@ GLOBAL_LIST_INIT(turfs_without_ground, typecacheof(list( /turf/open/chasm, /turf/open/lava, /turf/open/water, - /turf/open/openspace + /turf/open/openspace, + /turf/open/space/openspace ))) #define isgroundlessturf(A) (is_type_in_typecache(A, GLOB.turfs_without_ground)) +GLOBAL_LIST_INIT(turfs_openspace, typecacheof(list( + /turf/open/openspace, + /turf/open/space/openspace + ))) + +#define isopenspaceturf(A) (is_type_in_typecache(A, GLOB.turfs_openspace)) + #define isopenturf(A) (istype(A, /turf/open)) #define isindestructiblefloor(A) (istype(A, /turf/open/indestructible)) @@ -78,8 +86,7 @@ GLOBAL_LIST_INIT(turfs_without_ground, typecacheof(list( #define ismonkey(A) (is_species(A, /datum/species/monkey)) #define isandroid(A) (is_species(A, /datum/species/android)) -//more carbon mobs - +//More carbon mobs #define isalien(A) (istype(A, /mob/living/carbon/alien)) #define islarva(A) (istype(A, /mob/living/carbon/alien/larva)) @@ -148,7 +155,6 @@ GLOBAL_LIST_INIT(turfs_without_ground, typecacheof(list( #define isclown(A) (istype(A, /mob/living/simple_animal/hostile/retaliate/clown)) - //Misc mobs #define isobserver(A) (istype(A, /mob/dead/observer)) @@ -242,7 +248,6 @@ GLOBAL_LIST_INIT(book_types, typecacheof(list( /obj/item/spellbook, /obj/item/storage/book))) - // Jobs #define is_job(job_type) (istype(job_type, /datum/job)) #define is_assistant_job(job_type) (istype(job_type, /datum/job/assistant)) diff --git a/code/datums/elements/movement_turf_changer.dm b/code/datums/elements/movement_turf_changer.dm index 25dff387b52..744c1f68132 100644 --- a/code/datums/elements/movement_turf_changer.dm +++ b/code/datums/elements/movement_turf_changer.dm @@ -26,7 +26,7 @@ SIGNAL_HANDLER var/turf/destination = target.loc - if(!isturf(destination) || istype(destination, turf_type)) + if(!isturf(destination) || istype(destination, turf_type) || isopenspaceturf(destination)) return destination.PlaceOnTop(turf_type)