Closed MonsterOfCookie closed 7 years ago
Mmmmm... I see your problem, but can't find a super-easy fix. I'd say you have 2 options:
Gdx.app.postRunnable
to unregister the listener on next rendering cycle? This workaround should solve the issue in your code. :eyes: Yea, postRunnable is what I went with, along with refactoring my states so I can avoid removing as well.
I couldn't see an easy fix straight away either, otherwise I would have PR'd :)
I will have a think on it though.
Thanks for making an awesome extension.
Issue details
If you have two listeners to a message, and the first one removes itself upon receiving that message, the other listener will not get the message delivered.
I believe it is because of the way the for loop is constructed in the discharge method
Reproduction steps/code
Create two listeners to the same message Have the first remove itself as a listener during the onMessageRecieved call The second listener will not get the call
Version of gdx-ai and/or relevant dependencies
1.8.0