1
0
* Chests send contents updates to client
This commit is contained in:
Tiger Wang 2014-02-11 22:04:11 +00:00
parent 892c7eb57f
commit c53406f0d4
2 changed files with 16 additions and 0 deletions

View File

@ -170,3 +170,18 @@ void cChestEntity::OpenNewWindow(void)
void cChestEntity::OnSlotChanged(cItemGrid * a_Grid, int a_SlotNum)
{
super::OnSlotChanged(a_Grid, a_SlotNum);
cWindow * Window = GetWindow();
if (Window != NULL)
{
Window->BroadcastWholeWindow();
}
}

View File

@ -49,6 +49,7 @@ public:
virtual void SaveToJson(Json::Value & a_Value) override;
virtual void SendTo(cClientHandle & a_Client) override;
virtual void UsedBy(cPlayer * a_Player) override;
virtual void OnSlotChanged(cItemGrid * a_Grid, int a_SlotNum) override;
/// Opens a new chest window for this chest. Scans for neighbors to open a double chest window, if appropriate.
void OpenNewWindow(void);