Skip to content

Commit

Permalink
fix: gossip menu item overflow (#180)
Browse files Browse the repository at this point in the history
Co-authored-by: 55Honey <71938210+55Honey@users.noreply.github.com>
  • Loading branch information
Tralenor and 55Honey committed Jun 15, 2024
1 parent 3fea22b commit 36e1c71
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/LuaEngine/PlayerMethods.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#define PLAYERMETHODS_H

#include "GameTime.h"
#include "GossipDef.h"

/***
* Inherits all methods from: [Object], [WorldObject], [Unit]
Expand Down Expand Up @@ -4038,7 +4039,15 @@ namespace LuaPlayer
const char* _promptMsg = Eluna::CHECKVAL<const char*>(L, 7, "");
uint32 _money = Eluna::CHECKVAL<uint32>(L, 8, 0);
#if defined TRINITY || AZEROTHCORE
player->PlayerTalkClass->GetGossipMenu().AddMenuItem(-1, _icon, msg, _sender, _intid, _promptMsg, _money, _code);
if (player->PlayerTalkClass->GetGossipMenu().GetMenuItemCount() < GOSSIP_MAX_MENU_ITEMS)
{
player->PlayerTalkClass->GetGossipMenu().AddMenuItem(-1, _icon, msg, _sender, _intid, _promptMsg, _money,
_code);
}
else
{
return luaL_error(L, "GossipMenuItem not added. Reached Max amount of possible GossipMenuItems in this GossipMenu");
}
#else
#ifndef CLASSIC
player->PlayerTalkClass->GetGossipMenu().AddMenuItem(_icon, msg, _sender, _intid, _promptMsg, _money, _code);
Expand Down

0 comments on commit 36e1c71

Please sign in to comment.