FIUS / ICGE

Introduction Course Game Engine for the FIUS Java Introduction Course
MIT License
3 stars 2 forks source link

fixup! simulation/MovableEntity: Attempt to fix a bug where the ui froze. #38

Closed haslersn closed 5 years ago

haslersn commented 5 years ago

Supersedes #27.

Putting the addListener() call into spawn() was a bad idea. When the entity was spawned multiple times (for example if it gets dropped or setTerritory() was called inbetween, there were multiple listeners. (Also, the SpawnEvent wasn't handled properly.) The easiest thing for now is not to try to unregister the listeners.