From 4aea921ea106d36c191bf70fb8c19d4c4b24f899 Mon Sep 17 00:00:00 2001 From: Deity Link Date: Sun, 1 Sep 2024 20:55:48 +0200 Subject: [PATCH] fixes anim() interaction with firedoor causing them to become crossable. --- __DEFINES/atom_locking_and_control.dm | 1 + code/datums/locking_category.dm | 36 +++++++++++++----------- code/game/turfs/turf_flick_animations.dm | 5 +++- 3 files changed, 24 insertions(+), 18 deletions(-) diff --git a/__DEFINES/atom_locking_and_control.dm b/__DEFINES/atom_locking_and_control.dm index 9866ec2b2855..546a42575ab7 100644 --- a/__DEFINES/atom_locking_and_control.dm +++ b/__DEFINES/atom_locking_and_control.dm @@ -6,6 +6,7 @@ #define CANT_BE_MOVED_BY_LOCKED_MOBS 4 #define LOCKED_CAN_LIE_AND_STAND 8 #define LOCKED_STAY_INSIDE 16 +#define DONT_MESS_WITH_DENSITY 32 // Flags for atom.lockflags #define DENSE_WHEN_LOCKED 1 diff --git a/code/datums/locking_category.dm b/code/datums/locking_category.dm index d2b234411f90..1af0bd7ef8bf 100644 --- a/code/datums/locking_category.dm +++ b/code/datums/locking_category.dm @@ -25,8 +25,9 @@ AM.anchored = TRUE - if (flags & DENSE_WHEN_LOCKING || AM.lockflags & DENSE_WHEN_LOCKED) - owner.setDensity(TRUE) + if (!(flags & DONT_MESS_WITH_DENSITY)) + if (flags & DENSE_WHEN_LOCKING || AM.lockflags & DENSE_WHEN_LOCKED) + owner.setDensity(TRUE) AM.pixel_x += pixel_x_offset * PIXEL_MULTIPLIER AM.pixel_y += pixel_y_offset * PIXEL_MULTIPLIER @@ -89,21 +90,22 @@ AM.anchored = initial(AM.anchored) - // Okay so now we have to loop through ALL of the owner's locked atoms and their categories to see if the owner still needs to be dense. - var/found = FALSE - if (flags & DENSE_WHEN_LOCKING || AM.lockflags & DENSE_WHEN_LOCKED) - for (var/atom/movable/candidate in owner.locked_atoms) - if (candidate.lockflags & DENSE_WHEN_LOCKED) - found = TRUE - break - - var/datum/locking_category/cat = owner.locked_atoms[candidate] - if (cat.flags & DENSE_WHEN_LOCKING) - found = TRUE - break - - if (!found) - owner.setDensity(initial(owner.density)) + if (!(flags & DONT_MESS_WITH_DENSITY)) + // Okay so now we have to loop through ALL of the owner's locked atoms and their categories to see if the owner still needs to be dense. + var/found = FALSE + if (flags & DENSE_WHEN_LOCKING || AM.lockflags & DENSE_WHEN_LOCKED) + for (var/atom/movable/candidate in owner.locked_atoms) + if (candidate.lockflags & DENSE_WHEN_LOCKED) + found = TRUE + break + + var/datum/locking_category/cat = owner.locked_atoms[candidate] + if (cat.flags & DENSE_WHEN_LOCKING) + found = TRUE + break + + if (!found) + owner.setDensity(initial(owner.density)) if (ismob(AM)) var/mob/M = AM diff --git a/code/game/turfs/turf_flick_animations.dm b/code/game/turfs/turf_flick_animations.dm index 172aa999c5b6..93f4d04fc0e7 100644 --- a/code/game/turfs/turf_flick_animations.dm +++ b/code/game/turfs/turf_flick_animations.dm @@ -72,7 +72,7 @@ animation.transform = trans if (target && ismovable(target)) var/atom/movable/AM = target - AM.lock_atom(animation, /datum/locking_category/buckle) + AM.lock_atom(animation, /datum/locking_category/animation) if(a_icon_state) animation.icon_state = a_icon_state else @@ -85,6 +85,9 @@ return animation +/datum/locking_category/animation + flags = DONT_MESS_WITH_DENSITY + /* //called when the tile is cultified /turf/proc/cultification()