ID:1741227
 
(See the best response by NNAAAAHH.)
Code:
mob
proc
attack()
for(var/mob/m in orange(2))
m.damage(10)


Problem description:

The damage stacks randomly on enemies. I'm sure you're supposed to use the continue proc in some form of way, I just seem to be misusing it. If not, what can I do to prevent the damage from stacking onto the next target, while still having the attack hit all enemies within orange()?
mob
proc
attack()
var/T=0
for(var/mob/m in orange(2)) // personally i would use obounds
if(T==1) return
T++
m.damage(10)
Are there any sleep()s or other delays in the damage() proc or any procs it may call? If so, they'll hold up the iterations of that loop as well. You can get around it by spawn()ing the call to damage(), or changing damage() so it spawn()s any delays internally.

Otherwise the loop looks fine. Although, you might want to specify the center of orange() as the src, since it defaults to usr.
Best response
If you're meaning to attack only one mob, you'd want to look at break. Keep in mind all of the built-in procs(range,bounds,view,ect) build the list from the bottom left corner to the top right. I am fairly sure it reads bottom-left to bottom-right and ascends from there.

Otherwise, I don't see the problem with the code you provided, granted that damage() doesn't hold the for() loop for long. The damage shouldn't stack(and since the built in procs like range() are static once created, you shouldn't have a instance where the same mob is included twice).