Respect return value of cLuaWindow's OnClicked handler (#4322)
This commit is contained in:
parent
85006d10f5
commit
52e6543ba5
@ -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());
|
||||
|
Loading…
Reference in New Issue
Block a user