For example I want it so the user cannot move out of 8 squares from anyone of their soldier. This is the code I have so far but I just cant seem to get it to work. All it does is stick the users mob on the spot and continually print "Out Of Range" to the screen.
mob
Move()
if(src.selected == 1)
if(src.action_points > 0)
src.action_points -= 1
usr.APRefresh()
..()
else
world << "Not enough AP for this action!"
else
for(var/mob/soldier/M in world)
var/dist = get_dist(src, M)
if(dist > 8)
src << "Out Of Range"
step_towards(src,M)
else
..()
Any help anyone?
Thanks in advance
- GunRunner
if (get_dist(a, b) < limit) . = ..()