ID:149374
 
Would anybody have a close look at the code i am doing. I dont know whether or not to post it on the forum because it is so big. Can someone tell me if they want to help me fix it. I will post a small bit of it.

This is the main problme. Whenever i attack it doesnt come up with who is attacking who and freezes the character



TakeAction()
var/action_taken

// Before moving, NPC cops see if there is someone to attack within 1 space.
for (var/mob/other_mob in oview(1, src))
// But don't attack if it's another cop or they are dead...
if (istype(other_mob, /mob/horse))
continue
other_mob.opponent = usr
usr.opponent = other_mob
usr.move = 0
other_mob.move = 0
other_mob.attack(usr)
PCattack(other_mob)
action_taken = 1


// No one to attack, so see if a non-cop is within 3 spaces to move toward.
for (var/mob/other_mob in oview(3, src))
if (istype(other_mob, /mob/horse))
continue

step_towards(src, other_mob)
action_taken = 1

if (action_taken)
return

// No one around, so do the default behavior.
..()


You may have to look at Kurnaks new turn based combat sytem to see what i am saying.