From c25b41ca5f86c93d62b51bb2d4a9ce84cb2dcc94 Mon Sep 17 00:00:00 2001 From: ZomgPonies Date: Tue, 27 May 2014 20:53:56 -0400 Subject: [PATCH] Revert "Refactor get_turf proc." This reverts commit 5344e12b2553b7420953db58c27e45a11d045097. --- code/__HELPERS/unsorted.dm | 23 +++++++---------------- 1 file changed, 7 insertions(+), 16 deletions(-) diff --git a/code/__HELPERS/unsorted.dm b/code/__HELPERS/unsorted.dm index 0f051e08f72..9671769aaef 100644 --- a/code/__HELPERS/unsorted.dm +++ b/code/__HELPERS/unsorted.dm @@ -1234,21 +1234,12 @@ proc/get_mob_with_client_list() else return zone -/proc/get_turf(const/atom/O) - if (isnull(O) || isarea(O)) - return - - var/atom/A = O - - for (var/i = 0, ++i <= 20) - if (isturf(A)) - return A - - switch (istype(A)) - if (1) - A = A.loc - if (0) - return +/proc/get_turf(turf/location) + while(location) + if(isturf(location)) + return location + location = location.loc + return null /proc/get(atom/loc, type) while(loc) @@ -1630,4 +1621,4 @@ atom/proc/GetTypeInAllContents(typepath) processed |= A - return found + return found \ No newline at end of file