From 30e79f6cc1d0b4466b58fec0221021501b79cc90 Mon Sep 17 00:00:00 2001 From: SkyratBot <59378654+SkyratBot@users.noreply.github.com> Date: Thu, 7 Sep 2023 19:22:10 +0200 Subject: [PATCH] [MIRROR] Meteor turfs typecache [MDB IGNORE] (#23565) * Meteor turfs typecache (#78152) ## About The Pull Request When looking why meteors randomly explode sometimes, the check has it taking damage and exploding from turfs that it should just be flying over. This creates a typecache of turfs the meteor shouldn't deplete health from flying over. Most commonly openspace and asteroid baseturf. ## Why It's Good For The Game Meteor is more likely to explode when it actually hits something vs flying into an openspace tile. ## Changelog :cl: LT3 fix: Meteors no longer take damage from crossing certain unoccupied turfs /:cl: --------- Co-authored-by: san7890 * Meteor turfs typecache --------- Co-authored-by: lessthanthree <83487515+lessthnthree@users.noreply.github.com> Co-authored-by: san7890 --- code/__DEFINES/is_helpers.dm | 9 +++++++++ code/modules/meteors/meteor_types.dm | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/code/__DEFINES/is_helpers.dm b/code/__DEFINES/is_helpers.dm index 84c475779cd..3c4ebd9d124 100644 --- a/code/__DEFINES/is_helpers.dm +++ b/code/__DEFINES/is_helpers.dm @@ -64,6 +64,15 @@ GLOBAL_LIST_INIT(turfs_openspace, typecacheof(list( #define iscliffturf(A) (istype(A, /turf/open/cliff)) +GLOBAL_LIST_INIT(turfs_pass_meteor, typecacheof(list( + /turf/closed/mineral, + /turf/open/misc/asteroid, + /turf/open/openspace, + /turf/open/space +))) + +#define ispassmeteorturf(A) (is_type_in_typecache(A, GLOB.turfs_pass_meteor)) + //Mobs #define isliving(A) (istype(A, /mob/living)) diff --git a/code/modules/meteors/meteor_types.dm b/code/modules/meteors/meteor_types.dm index 9f598f9809e..b258196ed24 100644 --- a/code/modules/meteors/meteor_types.dm +++ b/code/modules/meteors/meteor_types.dm @@ -56,7 +56,7 @@ var/turf/T = get_turf(loc) ram_turf(T) - if(prob(10) && !isspaceturf(T))//randomly takes a 'hit' from ramming + if(prob(10) && !ispassmeteorturf(T))//randomly takes a 'hit' from ramming get_hit() if(z != z_original || loc == get_turf(dest))