mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 10:43:20 +00:00
10 lines
300 B
Plaintext
10 lines
300 B
Plaintext
/atom/proc/get_ultimate_mob() //seems like the wrong place for it, but other stuff uses this
|
|
var/mob/ultimate_mob
|
|
var/atom/to_check = loc
|
|
var/n = 0
|
|
while (to_check && !isturf(to_check) && n++ < 16)
|
|
if (ismob(to_check))
|
|
ultimate_mob = to_check
|
|
to_check = to_check.loc
|
|
return ultimate_mob
|