1
0
Fork 0

A player's inventory is always opened by its owner. (#4176)

Fixes #4093

Window updates are only broadcast to players in the m_OpenedBy list. Normally players are added after sending a window open packet but no packet is sent for a player's inventory. This meant broadcasts were never sent for the inventory window.
This commit is contained in:
peterbell10 2018-01-28 17:24:59 +00:00 committed by GitHub
parent 95108c134d
commit f0c735e846
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 4 deletions

View File

@ -328,11 +328,13 @@ bool cWindow::ClosedByPlayer(cPlayer & a_Player, bool a_CanRefuse)
(*itr)->OnPlayerRemoved(a_Player);
} // for itr - m_SlotAreas[]
m_OpenedBy.remove(&a_Player);
if ((m_WindowType != wtInventory) && m_OpenedBy.empty())
if (m_WindowType != wtInventory)
{
Destroy();
m_OpenedBy.remove(&a_Player);
if (m_OpenedBy.empty())
{
Destroy();
}
}
}
if (m_IsDestroyed)