Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix gossip menu item overflow #180

Merged
merged 6 commits into from
Jun 15, 2024

Conversation

Tralenor
Copy link

@Tralenor Tralenor commented Jun 15, 2024

closes #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
Copy link
Author

thanks for fixing the codestyle!

@55Honey 55Honey merged commit 36e1c71 into azerothcore:master Jun 15, 2024
1 check passed
@55Honey
Copy link
Member

55Honey commented Jun 15, 2024

Thank you for the fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

If GossipMenuAddItem larger than 32 times, the server will crash.
2 participants