diff --git a/code/controllers/subsystem/movement/movement_types.dm b/code/controllers/subsystem/movement/movement_types.dm index bf4b6a43029..ebb12c84e4b 100644 --- a/code/controllers/subsystem/movement/movement_types.dm +++ b/code/controllers/subsystem/movement/movement_types.dm @@ -101,6 +101,10 @@ controller.queue_loop(src) /datum/move_loop/process() + if(isnull(controller)) + qdel(src) + return + var/old_delay = delay //The signal can sometimes change delay if(SEND_SIGNAL(src, COMSIG_MOVELOOP_PREPROCESS_CHECK) & MOVELOOP_SKIP_STEP) //Chance for the object to react @@ -441,7 +445,8 @@ // this check if we're on exactly the next tile may be overly brittle for dense objects who may get bumped slightly // to the side while moving but could maybe still follow their path without needing a whole new path if(get_turf(moving) == next_step) - movement_path.Cut(1,2) + if(length(movement_path)) + movement_path.Cut(1,2) else INVOKE_ASYNC(src, PROC_REF(recalculate_path)) return MOVELOOP_FAILURE diff --git a/code/modules/admin/verbs/debug.dm b/code/modules/admin/verbs/debug.dm index 7d6ab6e2548..260bfb16bf3 100644 --- a/code/modules/admin/verbs/debug.dm +++ b/code/modules/admin/verbs/debug.dm @@ -217,6 +217,8 @@ if(tgui_alert(usr,"This mob is being controlled by [M.key]. Are you sure you wish to give someone else control of it? [M.key] will be made a ghost.",,list("Yes","No")) != "Yes") return var/client/newkey = input(src, "Pick the player to put in control.", "New player") as null|anything in sort_list(GLOB.clients) + if(isnull(newkey)) + return var/mob/oldmob = newkey.mob var/delmob = FALSE if((isobserver(oldmob) || tgui_alert(usr,"Do you want to delete [newkey]'s old mob?","Delete?",list("Yes","No")) != "No"))