mob/monsters
Enemy
New()
..()
spawn(-1) src.CombatAI()
return ..()
mob/monsters/proc/CombatAI()
while(src)
for(var/mob/Player/M in oview())
if(get_dist(src,M)<=3)
src.dir=get_dir(src,M)
else
step_to(src,M)
break
sleep(rand(4,8))
Problem description:
When I am using this code my cpu is higher by 4% so can someone please tell me what am i doing wrong here.Ty