From 8378cbe2bd7b7680d94b83cc7df8ca65389772fb Mon Sep 17 00:00:00 2001 From: Zonespace <41448081+Zonespace27@users.noreply.github.com> Date: Fri, 17 Nov 2023 13:28:06 -0800 Subject: [PATCH] Fix adminjump.dm to handle empty area_turfs list --- code/modules/admin/verbs/adminjump.dm | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/code/modules/admin/verbs/adminjump.dm b/code/modules/admin/verbs/adminjump.dm index cef0625c0adf..2806b8c3bad2 100644 --- a/code/modules/admin/verbs/adminjump.dm +++ b/code/modules/admin/verbs/adminjump.dm @@ -15,11 +15,17 @@ if(!src.mob) return + var/list/area_turfs = get_area_turfs(A) + + if(!length(area_turfs)) + to_chat(src, "There aren't any turfs in this area!") + return + if(!isobserver(mob)) src.admin_ghost() src.mob.on_mob_jump() - src.mob.forceMove(pick(get_area_turfs(A))) + src.mob.forceMove(pick(area_turfs)) message_admins(WRAP_STAFF_LOG(usr, "jumped to area [get_area(usr)] ([usr.loc.x],[usr.loc.y],[usr.loc.z])."), usr.loc.x, usr.loc.y, usr.loc.z)