Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions __DEFINES/atom_locking_and_control.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
36 changes: 19 additions & 17 deletions code/datums/locking_category.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
5 changes: 4 additions & 1 deletion code/game/turfs/turf_flick_animations.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -85,6 +85,9 @@

return animation

/datum/locking_category/animation
flags = DONT_MESS_WITH_DENSITY

/*
//called when the tile is cultified
/turf/proc/cultification()
Expand Down
Loading