fix: gossip menu item overflow (#180)

Co-authored-by: 55Honey <71938210+55Honey@users.noreply.github.com>
This commit is contained in:
Tralenor
2024-06-15 13:11:46 +02:00
committed by GitHub
parent 3fea22bc41
commit 36e1c715fc

View File

@@ -8,6 +8,7 @@
#define PLAYERMETHODS_H #define PLAYERMETHODS_H
#include "GameTime.h" #include "GameTime.h"
#include "GossipDef.h"
/*** /***
* Inherits all methods from: [Object], [WorldObject], [Unit] * Inherits all methods from: [Object], [WorldObject], [Unit]
@@ -4038,7 +4039,15 @@ namespace LuaPlayer
const char* _promptMsg = Eluna::CHECKVAL<const char*>(L, 7, ""); const char* _promptMsg = Eluna::CHECKVAL<const char*>(L, 7, "");
uint32 _money = Eluna::CHECKVAL<uint32>(L, 8, 0); uint32 _money = Eluna::CHECKVAL<uint32>(L, 8, 0);
#if defined TRINITY || AZEROTHCORE #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 #else
#ifndef CLASSIC #ifndef CLASSIC
player->PlayerTalkClass->GetGossipMenu().AddMenuItem(_icon, msg, _sender, _intid, _promptMsg, _money, _code); player->PlayerTalkClass->GetGossipMenu().AddMenuItem(_icon, msg, _sender, _intid, _promptMsg, _money, _code);