azerothcore / mod-eluna

Eluna Lua Engine © for WoW Emulators
https://elunaluaengine.github.io/
GNU General Public License v3.0
96 stars 126 forks source link

Fix gossip menu item overflow #180

Closed Tralenor closed 2 months ago

Tralenor commented 2 months ago

closes https://github.com/azerothcore/mod-eluna/issues/118

How to Test: use this code to verify server doesn't crash after attempting to add more than 32 GossipMenuItems

local function hello(event, player, object)
    for n = 1, 40, 1 do
        player:GossipMenuAddItem(1, "Text "..n, 20124, n)
        print("added: "..n)
    end
    player:GossipSendMenu(0, object, 0)
end

RegisterCreatureGossipEvent(20124, 1, hello)

(Code copied from @55Honey in the issue linked above)

Expected Output in world-server console: grafik

Tralenor commented 2 months ago

thanks for fixing the codestyle!

55Honey commented 2 months ago

Thank you for the fix!