ID:149038
 
When I are any of my team go past a nother team mate he stops attacking then when hes out of range he starts attacking again.


proc/move2()//Now, this proc handles NPC movement
for(var/mob/M in oview(5))//loops over all mobs in view
if(get_step_away(src,M,5))//checks distance
if(M.team==src.team)//Not a player
continue//continues through the loop
move2()
else//Player
attackplayer2()

else//4-or-more spaces away
continue
spawn(15) move2()//loops the proc after 2 seconds
               proc/move2()//Now, this proc handles NPC movement
for(var/mob/M)//loops over all mobs in view
if(get_dist(src,M,5))//checks distance
if(M.team==src.team)//Not a player
continue//continues through the loop
move2()
else//Player
attackplayer2()

else//4-or-more spaces away
continue
spawn(15) move2()//loops the proc after 2 seconds


Tell me if this works, i havn't tested. So just let me know.

RaeKwon
In response to RaeKwon
No it doesnt work and thats not the error the error is that when a person thats on thats units team comes in range it stops attacking.
In response to Rollerc
remove your return