azerothcore / mod-eluna

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

If GossipMenuAddItem larger than 32 times, the server will crash. #118

Closed kissingers closed 4 months ago

kissingers commented 1 year ago

If GossipMenuAddItem larger than 32 times, the server will crash. Can limit or give an error message to prevent it?

55Honey commented 1 year ago

image Confirmed with

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)