mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-23 21:18:37 +01:00
Faster get_turf() courtesy /vg/ (#19093)
Uses a single get_step call instead, works via byond black magic
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user