mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 10:43:20 +00:00
10 lines
471 B
Plaintext
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 |