Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes mobs unable to move after being flung while buckled. #5464

Merged
merged 3 commits into from
Jan 17, 2024
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
5 changes: 4 additions & 1 deletion code/modules/mob/living/living.dm
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,10 @@
/mob/living/launch_towards(datum/launch_metadata/LM)
if(src)
SEND_SIGNAL(src, COMSIG_MOB_MOVE_OR_LOOK, TRUE, dir, dir)
if(!istype(LM) || !LM.target || !src || buckled)
if(!istype(LM) || !LM.target || !src)
return
if(buckled)
LM.invoke_end_throw_callbacks(src)
Drulikar marked this conversation as resolved.
Show resolved Hide resolved
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