From 2fc033ee0eeb76a2665465403c8c807871ee439a Mon Sep 17 00:00:00 2001 From: comma Date: Mon, 4 Jul 2016 00:11:50 +0300 Subject: [PATCH] Ports /vg/ get_turf Gotta go faster. Possibly undocumented behaviour of get_step? --- code/_helpers/unsorted.dm | 6 ------ code/_macros.dm | 2 ++ code/game/objects/structures/girders.dm | 2 +- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/code/_helpers/unsorted.dm b/code/_helpers/unsorted.dm index 1e14d39183..d8623fa3eb 100644 --- a/code/_helpers/unsorted.dm +++ b/code/_helpers/unsorted.dm @@ -1037,12 +1037,6 @@ proc/get_mob_with_client_list() else if (zone == "r_foot") return "right foot" else return zone -//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/movable/A) - if(isturf(A)) return A - if(A && A.locs.len) return A.locs[1] - /proc/get(atom/loc, type) while(loc) if(istype(loc, type)) diff --git a/code/_macros.dm b/code/_macros.dm index 801498d915..06376205d1 100644 --- a/code/_macros.dm +++ b/code/_macros.dm @@ -1,6 +1,8 @@ #define Clamp(x, y, z) (x <= y ? y : (x >= z ? z : x)) #define CLAMP01(x) (Clamp(x, 0, 1)) +#define get_turf(A) get_step(A,0) + #define isAI(A) istype(A, /mob/living/silicon/ai) #define isalien(A) istype(A, /mob/living/carbon/alien) diff --git a/code/game/objects/structures/girders.dm b/code/game/objects/structures/girders.dm index 9c103a8ed2..aa961f4c10 100644 --- a/code/game/objects/structures/girders.dm +++ b/code/game/objects/structures/girders.dm @@ -65,7 +65,7 @@ else if(!anchored) playsound(src.loc, 'sound/items/Ratchet.ogg', 100, 1) user << "Now securing the girder..." - if(get_turf(user, 40)) + if(do_after(user, 40,src)) user << "You secured the girder!" reset_girder()