Inventory changes (#4561)

Co-Authored-By: peterbell10 <peterbell10@live.co.uk>
This commit is contained in:
Mat
2020-03-28 13:52:40 +00:00
committed by GitHub
co-authored by peterbell10
parent 964437dc95
commit fce548139b
3 changed files with 14 additions and 17 deletions
+2 -5
View File
@@ -28,15 +28,13 @@ Byte cWindow::m_WindowIDCounter = 0;
cWindow::cWindow(WindowType a_WindowType, const AString & a_WindowTitle) :
m_WindowID(static_cast<char>((++m_WindowIDCounter) % 127)),
m_WindowID(((++m_WindowIDCounter) % 127) + 1),
m_WindowType(a_WindowType),
m_WindowTitle(a_WindowTitle),
m_IsDestroyed(false),
m_Owner(nullptr)
{
// The window ID is signed in protocol 1.7, unsigned in protocol 1.8. Keep out of trouble by using only 7 bits:
// Ref.: https://forum.cuberite.org/thread-1876.html
ASSERT((m_WindowID >= 0) && (m_WindowID < 127));
ASSERT((m_WindowID > 0) && (m_WindowID <= 127));
if (a_WindowType == wtInventory)
{
@@ -768,4 +766,3 @@ void cWindow::SetProperty(short a_Property, short a_Value, cPlayer & a_Player)