mob
verb
Target()
var/Player/M
var/mob/T = Target
if(!Target)
for(M in obounds(usr, 500))
Target = M
break
return
if(Target)
Target = null
for(M in obounds(usr, 500) - T)
Target = M
break
return
Problem description:
Trying to make a macro-based targeting system, and it works, but only with 2 mobs (other than the player.) More than 2 and it just switches back and forth between 2 of them. I know I've done one of these before a few years ago but I just can't figure it out.
Help would be appreciated thanks!
Aside from this, your code seems to do this:
- if Target is null, take the first Mob available
- if Target is not null make it null and take the first Mob available with the exception of Target
so it's normal it cycles between the same 2 mobs all the time, there is nothing that would allow the code to go any further.
What is it exactly that you want it to do?