From af86b8a935c272c7f03112d71552043c6d5f4fae Mon Sep 17 00:00:00 2001 From: PsiOmega Date: Mon, 31 Aug 2015 08:45:20 +0200 Subject: [PATCH] Ports LummoxJr's get_turf() --- code/_helpers/unsorted.dm | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/code/_helpers/unsorted.dm b/code/_helpers/unsorted.dm index 366fcbbbc10..69c891d2a41 100644 --- a/code/_helpers/unsorted.dm +++ b/code/_helpers/unsorted.dm @@ -1053,12 +1053,10 @@ proc/get_mob_with_client_list() //gets the turf the atom is located in (or itself, if it is a turf). //returns null if the atom is not in a turf. -/proc/get_turf(atom/location) - while(location) - if(isturf(location)) - return location - location = location.loc - return null +/proc/get_turf(atom/A) + if(!istype(A)) return + for(A, A && !isturf(A), A=A.loc); + return A /proc/get(atom/loc, type) while(loc)