mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 18:22:39 +00:00
Splits setup.dm into berjillion of smaller files vaguely named thematically.
Also moved __HELPERS and _defines around so defines actually come first.
This commit is contained in:
19
code/_helpers/turfs.dm
Normal file
19
code/_helpers/turfs.dm
Normal file
@@ -0,0 +1,19 @@
|
||||
// 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))
|
||||
|
||||
/proc/turf_clear(turf/T)
|
||||
for(var/atom/A in T)
|
||||
if(A.simulated)
|
||||
return 0
|
||||
return 1
|
||||
Reference in New Issue
Block a user