mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 10:43:20 +00:00
stack/use() now only deletes an empty stack after the current context yields, removing the need for some awkward patterns when dealing with stacks. Also adds procs for transferring and splitting stacks.
14 lines
593 B
Plaintext
14 lines
593 B
Plaintext
// Returns the atom sitting on the turf.
|
|
// For example, using this on a disk, which is in a bag, on a mob, will return the mob because it's on the turf.
|
|
/proc/get_atom_on_turf(var/atom/movable/M)
|
|
var/atom/mloc = M
|
|
while(mloc && mloc.loc && !istype(mloc.loc, /turf/))
|
|
mloc = mloc.loc
|
|
return mloc
|
|
|
|
/proc/iswall(turf/T)
|
|
return (istype(T, /turf/simulated/wall) || istype(T, /turf/unsimulated/wall) || istype(T, /turf/simulated/shuttle/wall))
|
|
|
|
/proc/isfloor(turf/T)
|
|
return (istype(T, /turf/simulated/floor) || istype(T, /turf/unsimulated/floor) || istype(T, /turf/simulated/shuttle/floor))
|