Files
CHOMPStation2/code/_helpers/unsorted_vr.dm

10 lines
471 B
Plaintext

/*
get_holder_at_turf_level(): Similar to get_turf(), will return the "highest up" holder of this atom, excluding the turf.
Example: A fork inside a box inside a locker will return the locker. Essentially, get_just_before_turf().
*/ //Credit to /vg/
/proc/get_holder_at_turf_level(const/atom/movable/O)
if(!istype(O)) //atom/movable does not include areas
return
var/atom/A
for(A=O, A && !isturf(A.loc), A=A.loc); // semicolon is for the empty statement
return A