Closed wooneusean closed 3 years ago
That line was added to correctly stop the current attack if the bot was already in the middle of attacking another entity. Simply removing that line will prevent the stoppedAttacking from the first target to be called. I made a quick PR to fix this.
I suggest the removal of this line.
I have found that calling
stop()
here will make the bot receive astoppedAttacking
event even though they have just started attacking. At the end of the attack,stop()
will be called again. This is, in my opinion, not really intuitive, since it will clash with thestartedAttacking
event especially if the callback is async.After removing this line, I found that the events emitted makes more sense than how it is now.
I understand that this may be used to show that the bot has changed targets but putting it in one general event of
stoppedAttacking
is not intuitive.