Skip to content

Commit

Permalink
fixes trait immobilised not being removed when buckled mobs are flung
Browse files Browse the repository at this point in the history
  • Loading branch information
Birdtalon committed Jan 15, 2024
1 parent ca06598 commit cbe9a88
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
1 change: 1 addition & 0 deletions code/modules/mob/living/living.dm
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,7 @@
if(src)
SEND_SIGNAL(src, COMSIG_MOB_MOVE_OR_LOOK, TRUE, dir, dir)
if(!istype(LM) || !LM.target || !src || buckled)
LM.invoke_end_throw_callbacks(src)
return
if(pulling)
stop_pulling() //being thrown breaks pulls.
Expand Down
17 changes: 11 additions & 6 deletions code/modules/movement/launching/launching.dm
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,16 @@
matching_procs += collision_callbacks[path]
return matching_procs

/// Invoke end_throw_callbacks on this metadata.
/// Takes argument of type /atom/movable
/datum/launch_metadata/proc/invoke_end_throw_callbacks(atom/movable/movable_atom)
if(length(end_throw_callbacks))
for(var/datum/callback/callback as anything in end_throw_callbacks)
if(istype(callback, /datum/callback/dynamic))
callback.Invoke(movable_atom)
else
callback.Invoke()

/atom/movable/var/datum/launch_metadata/launch_metadata = null

//called when src is thrown into hit_atom
Expand Down Expand Up @@ -210,12 +220,7 @@
rebounding = FALSE
cur_speed = old_speed
remove_temp_pass_flags(pass_flags)
if(length(LM.end_throw_callbacks))
for(var/datum/callback/CB as anything in LM.end_throw_callbacks)
if(istype(CB, /datum/callback/dynamic))
CB.Invoke(src)
else
CB.Invoke()
LM.invoke_end_throw_callbacks(src)
QDEL_NULL(launch_metadata)

/atom/movable/proc/throw_random_direction(range, speed = 0, atom/thrower, spin, launch_type = NORMAL_LAUNCH, pass_flags = NO_FLAGS)
Expand Down

0 comments on commit cbe9a88

Please sign in to comment.