ID:266387
 
mob/verb/Dig()
for(var/turf/River in locate(src.x,src.y,src.z)) return
// do dig stuff

It would seem to me that the little snippet above would keep a mob from using dig while in the river. However, you can dig just like normal! How do I keep somebody from digging in the river?

-Lord of Water
var/turf/T = locate(src.x,src.y,src.z)
if(istype(T, /turf/River)) return


That should work.
Lord of Water wrote:
mob/verb/Dig()
> for(var/turf/River in locate(src.x,src.y,src.z)) return
> // do dig stuff

It would seem to me that the little snippet above would keep a mob from using dig while in the river. However, you can dig just like normal! How do I keep somebody from digging in the river?

The reason you're having trouble is that you're searching for a turf within a turf's contents. This isn't possible, so there will never be a /turf/River in the contents of the turf returned by locate().

Lummox JR
Lord of Water wrote:
mob/verb/Dig()
> for(var/turf/River in locate(src.x,src.y,src.z)) return
> // do dig stuff


The problem is that your variable isn't of type River, it's just called river, you'd have to do it like this:

for(var/turf/River/R in locate(src.x,src.y,src.z)) return

That would work because locate simply returns the location of whatever is calling locate. In this case it's a mob so the location will be a turf (unless you like putting mobs in bags that is...).