LandSandBoat / server

:sailboat: LandSandBoat - a server emulator for Final Fantasy XI
https://landsandboat.github.io/server/
GNU General Public License v3.0
302 stars 608 forks source link

Core: Fix possible iterator invalidation in event handler #6391

Closed zach2good closed 2 weeks ago

zach2good commented 3 weeks ago

I affirm:

What does this pull request do?

Tested with this on mob init, all expected values printed correctly:


    print("=== GOBLIN")
    print("hasListener ATTACK:", mob:hasListener('ATTACK')) -- expect false
    mob:addListener('ATTACK', 'COLLECTOR_ATTACK', function() end)
    print("hasListener ATTACK:", mob:hasListener('ATTACK')) -- expect true
    mob:removeListener('COLLECTOR_ATTACK')
    print("hasListener ATTACK:", mob:hasListener('ATTACK')) -- expect false
zach2good commented 2 weeks ago

Tested and now out of draft 👍