mob/NPC/proc/Makemove()
mob/NPC/proc/NPCMove(tx,ty,tz)
var/area/temparea/targetlocation = new(locate(tx,ty,tz))
for(var/turf/targetturf in targetlocation)
if(targetturf.density == 1)
src.cantmove = 1
for(var/obj/targetobj in targetlocation)
if(targetobj.density == 1)
src.cantmove = 1
if(src.cantmove == 0)
src.loc = locate(tx, ty, tz)
for(var/area/temparea/wtf in world)
new /area/World(wtf.loc)
src.cantmove = 0
mob
NPC
Friendly_Humans
Male
Walkingaround
Makemove()
var/goingto = pick("North","East","South","West")
switch(goingto)
if("North")
NPCMove(x,y+1,z)
if("East")
NPCMove(x+1,y,z)
if("South")
NPCMove(x,y-1,z)
if("West")
NPCMove(x-1,y,z)
Problem description:
My NPC walks through dense objects and turfs, even though it's coded not to move there if there's a dense object or turf. Why is this??
Remember, return is your friend!