Faster get_turf() courtesy /vg/ (#19093)

Uses a single get_step call instead, works via byond black magic
This commit is contained in:
Joan Lung
2016-07-05 00:08:47 +12:00
committed by oranges
parent 87c152f24f
commit e33e44357b
2 changed files with 3 additions and 10 deletions
+3
View File
@@ -319,6 +319,9 @@ var/list/bloody_footprints_cache = list()
//subtypesof(), typesof() without the parent path
#define subtypesof(typepath) ( typesof(typepath) - typepath )
//Gets the turf this atom inhabits
#define get_turf(A) (get_step(A, 0))
//Bot types
#define SEC_BOT 1 // Secutritrons (Beepsky) and ED-209s
#define MULE_BOT 2 // MULEbots
-10
View File
@@ -720,16 +720,6 @@ Turf and target are seperate in case you want to teleport some distance from a t
else
return zone
//Gets the turf this atom inhabits
/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
/*
Gets the turf this atom's *ICON* appears to inhabit