diff options
author | Mat <mail@mathias.is> | 2020-03-28 14:52:40 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-28 14:52:40 +0100 |
commit | fce548139b8c4643cd28f636d5c497d2ca8cd230 (patch) | |
tree | 76810a291e6cf8cf2c2a10d9fa2c4fd447725323 /src/UI/Window.cpp | |
parent | Fix alpha-sorting (diff) | |
download | cuberite-fce548139b8c4643cd28f636d5c497d2ca8cd230.tar cuberite-fce548139b8c4643cd28f636d5c497d2ca8cd230.tar.gz cuberite-fce548139b8c4643cd28f636d5c497d2ca8cd230.tar.bz2 cuberite-fce548139b8c4643cd28f636d5c497d2ca8cd230.tar.lz cuberite-fce548139b8c4643cd28f636d5c497d2ca8cd230.tar.xz cuberite-fce548139b8c4643cd28f636d5c497d2ca8cd230.tar.zst cuberite-fce548139b8c4643cd28f636d5c497d2ca8cd230.zip |
Diffstat (limited to '')
-rw-r--r-- | src/UI/Window.cpp | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/UI/Window.cpp b/src/UI/Window.cpp index 92e69e8b7..b59268ac4 100644 --- a/src/UI/Window.cpp +++ b/src/UI/Window.cpp @@ -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) - |