ID:1532602
 
Code:
turf/Dirt
icon = 'grass.dmi'
icon_state = "dirt"
desc = "A brown powder that makes up the majority of Flooshland."
verb/Eat()
set src in view(0)
if(usr.ChkUse())
for(var/turf/T in locate(src.x,src.y,src.z + 1))
if(ispath(T,/turf/f))
usr << "\blue You try to dig out the dirt but there is something hard underneathe!"
return
usr << "\blue You scoop handfuls of dirt from the ground and shove them in your mouth!"
view() << "\blue [usr] is scooping [src] from the ground and eating it!"
if(usr.z <> 6)
new /turf/Dexit (locate(src.x,src.y,src.z + 1))
new /turf/Hole (src)


Problem description:
I tried many different variations of this code and it didn't work. I think I am using locate wrong.
locate(x, y, z) returns a turf. You can't loop "for each turf in turf". You'll just have to check the type (using istype, not ispath) of the result of locate().

if(istype(get_step(src, UP), /turf/f))
// same as locate(x, y, z + 1)
Thank you.