Port Runechat

This commit is contained in:
Aronai Sieyes
2021-05-29 01:38:36 -04:00
parent e0183093ca
commit ea42ee2303
17 changed files with 414 additions and 31 deletions
+2
View File
@@ -20,6 +20,8 @@
#define TICKS2DS(T) ((T) TICKS) // Convert ticks to deciseconds
#define DS2NEARESTTICK(DS) TICKS2DS(-round(-(DS2TICKS(DS))))
var/world_startup_time
/proc/get_game_time()
var/global/time_offset = 0
var/global/last_time = 0
+16
View File
@@ -1691,3 +1691,19 @@ GLOBAL_REAL_VAR(list/stack_trace_storage)
return "CLIENT: [D]"
else
return "Unknown data type: [D]"
/*
is_holder_of(): Returns 1 if A is a holder of B, meaning, A is B.loc or B.loc.loc or B.loc.loc.loc etc.
This is essentially the same as calling (locate(B) in A), but a little clearer as to what you're doing, and locate() has been known to bug out or be extremely slow in the past.
*/
/proc/is_holder_of(const/atom/movable/A, const/atom/movable/B)
if(istype(A, /turf) || istype(B, /turf)) //Clicking on turfs is a common thing and turfs are also not /atom/movable, so it was causing the assertion to fail.
return 0
ASSERT(istype(A) && istype(B))
var/atom/O = B
while(O && !isturf(O))
if(O == A)
return 1
O = O.loc
return 0