1
0
Fork 0

Respect return value of cLuaWindow's OnClicked handler (#4322)

This commit is contained in:
DaPorkchop_ 2019-06-11 12:07:35 +02:00 committed by Mattes D
parent 85006d10f5
commit 52e6543ba5
1 changed files with 2 additions and 1 deletions

View File

@ -218,7 +218,8 @@ void cLuaWindow::Clicked(cPlayer & a_Player, int a_WindowID, short a_SlotNum, eC
if (m_OnClicked != nullptr)
{
// Plugin can stop a click
if (m_OnClicked->Call(this, &a_Player, a_SlotNum, a_ClickAction, a_ClickedItem))
bool res;
if (m_OnClicked->Call(this, &a_Player, a_SlotNum, a_ClickAction, a_ClickedItem, cLuaState::Return, res) && res)
{
// Tell the client the actual state of the window
a_Player.GetClientHandle()->SendInventorySlot(-1, -1, a_Player.GetDraggingItem());