mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2026-08-30 08:39:12 +01:00
[MIRROR] Better stairs handling for climbable objects (#11101)
Co-authored-by: Will <7099514+Willburd@users.noreply.github.com>
This commit is contained in:
co-authored by
Will
parent
81e50dcc64
commit
0efea34f14
@@ -111,16 +111,15 @@
|
||||
return 1
|
||||
|
||||
/// Shakes an object, called from movement so it needs to be cleaned up a bit!
|
||||
/datum/element/climbable/proc/move_shaken(var/obj/climbed_thing, var/mob/user)
|
||||
/datum/element/climbable/proc/move_shaken(obj/climbed_thing, atom/oldloc, direction, forced, list/old_locs, momentum_change)
|
||||
SIGNAL_HANDLER
|
||||
shaken(climbed_thing, null)
|
||||
if(!forced) // Don't perform this if going up stairs
|
||||
shaken(climbed_thing, null)
|
||||
|
||||
/// Shakes an object, if anyone is climbing it, causes them to fall off it.
|
||||
/datum/element/climbable/proc/shaken(var/obj/climbed_thing, var/mob/user)
|
||||
SIGNAL_HANDLER
|
||||
var/list/climbers = LAZYACCESS(current_climbers, climbed_thing)
|
||||
for(var/i in climbers)
|
||||
|
||||
// You cannot shake yourself
|
||||
if(user) // Crates pass null on open because no user
|
||||
if(!LAZYLEN(climbers) || (user in climbers))
|
||||
@@ -137,6 +136,8 @@
|
||||
continue
|
||||
if(M.lying) //No spamming this on people.
|
||||
continue
|
||||
if(M.pulling == climbed_thing) // Pulling stuff up stairs can get weird
|
||||
continue
|
||||
|
||||
M.Weaken(3)
|
||||
to_chat(M, span_danger("You topple as \the [climbed_thing] moves under you!"))
|
||||
|
||||
Reference in New Issue
Block a user