From 5eb033520a99e1d73ca541182d9bb346c8304ec0 Mon Sep 17 00:00:00 2001 From: Zonespace <41448081+Zonespace27@users.noreply.github.com> Date: Sun, 19 Nov 2023 03:01:49 -0800 Subject: [PATCH] Fix jump-to-area runtime (#4946) # About the pull request Title. # Changelog :cl: fix: Jump-to-area verb will now warn you if there aren't any turfs in the given area. /:cl: --- 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)