Merge pull request #4882 from Fox-McCloud/fast-get-turf

Faster Get Turf from VG
This commit is contained in:
TheDZD
2016-07-05 11:36:17 -04:00
committed by GitHub
3 changed files with 3 additions and 8 deletions
+2
View File
@@ -157,6 +157,8 @@
for(type in view(range, dview_mob))
#define END_FOR_DVIEW dview_mob.loc = null
#define get_turf(A) (get_step(A, 0))
#define MIN_SUPPLIED_LAW_NUMBER 15
#define MAX_SUPPLIED_LAW_NUMBER 50
-7
View File
@@ -1010,13 +1010,6 @@ proc/get_mob_with_client_list()
else if (zone == "r_foot") return "right foot"
else return zone
/proc/get_turf(atom/A)
if (!istype(A))
return
for(A, A && !isturf(A), A=A.loc); //semicolon is for the empty statement
return A
//Finds the distance between two atoms, in pixels
//centered = 0 counts from turf edge to edge
//centered = 1 counts from turf center to turf center
+1 -1
View File
@@ -41,7 +41,7 @@
else if(!anchored)
playsound(src.loc, 'sound/items/Ratchet.ogg', 100, 1)
to_chat(user, "\blue Now securing the girder")
if(get_turf(user, 40))
if(do_after(user, 40, target = src))
to_chat(user, "\blue You secured the girder!")
new/obj/structure/girder( src.loc )
qdel(src)