diff --git a/src/AllocationPool.h b/src/AllocationPool.h index 799930708..b8fae4a95 100644 --- a/src/AllocationPool.h +++ b/src/AllocationPool.h @@ -64,7 +64,7 @@ public: } - virtual ~cListAllocationPool() + virtual ~cListAllocationPool() override { while (!m_FreeList.empty()) { diff --git a/src/Bindings/LuaChunkStay.h b/src/Bindings/LuaChunkStay.h index 175260978..f82647141 100644 --- a/src/Bindings/LuaChunkStay.h +++ b/src/Bindings/LuaChunkStay.h @@ -32,7 +32,7 @@ class cLuaChunkStay public: cLuaChunkStay(); - ~cLuaChunkStay() { } + virtual ~cLuaChunkStay() override { } /** Adds chunks in the specified Lua table. Can be called only once. diff --git a/src/Bindings/LuaServerHandle.h b/src/Bindings/LuaServerHandle.h index 7632669ff..1aad45f52 100644 --- a/src/Bindings/LuaServerHandle.h +++ b/src/Bindings/LuaServerHandle.h @@ -34,7 +34,7 @@ public: wrapping the (listen-) callbacks that are in the specified table. */ cLuaServerHandle(UInt16 a_Port, cLuaState::cTableRefPtr && a_Callbacks); - ~cLuaServerHandle(); + virtual ~cLuaServerHandle() override; /** Called by cNetwork::Listen()'s binding. Sets the server handle around which this instance is wrapped, and a self SharedPtr for link management. */ diff --git a/src/Bindings/LuaTCPLink.h b/src/Bindings/LuaTCPLink.h index f4ca67018..4211c3b64 100644 --- a/src/Bindings/LuaTCPLink.h +++ b/src/Bindings/LuaTCPLink.h @@ -35,7 +35,7 @@ public: /** Creates a new instance of the link, attached to the specified plugin and wrapping the callbacks that are in the specified referenced table. */ cLuaTCPLink(cLuaState::cTableRefPtr && a_Callbacks, cLuaServerHandleWPtr a_Server); - ~cLuaTCPLink(); + virtual ~cLuaTCPLink() override; /** Sends the data contained in the string to the remote peer. Returns true if successful, false on immediate failure (queueing the data failed or link not available). */ diff --git a/src/Bindings/LuaUDPEndpoint.h b/src/Bindings/LuaUDPEndpoint.h index 338ea6648..04c6ea134 100644 --- a/src/Bindings/LuaUDPEndpoint.h +++ b/src/Bindings/LuaUDPEndpoint.h @@ -31,7 +31,7 @@ public: /** Creates a new instance of the endpoint, wrapping the callbacks that are in the specified table. */ cLuaUDPEndpoint(cLuaState::cTableRefPtr && a_Callbacks); - ~cLuaUDPEndpoint(); + virtual ~cLuaUDPEndpoint() override; /** Opens the endpoint so that it starts listening for incoming data on the specified port. a_Self is the shared pointer to self that the object keeps to keep itself alive for as long as it needs (for Lua). */ diff --git a/src/Bindings/LuaWindow.h b/src/Bindings/LuaWindow.h index d90d52a94..66efb2a32 100644 --- a/src/Bindings/LuaWindow.h +++ b/src/Bindings/LuaWindow.h @@ -42,7 +42,7 @@ public: cLuaWindow(cLuaState & a_LuaState, cWindow::WindowType a_WindowType, int a_SlotsX, int a_SlotsY, const AString & a_Title); // tolua_begin - virtual ~cLuaWindow(); + virtual ~cLuaWindow() override; /** Returns the internal representation of the contents that are manipulated by Lua */ cItemGrid & GetContents(void) { return m_Contents; } diff --git a/src/Bindings/PluginLua.h b/src/Bindings/PluginLua.h index 703cb8ead..af336f0a0 100644 --- a/src/Bindings/PluginLua.h +++ b/src/Bindings/PluginLua.h @@ -63,7 +63,7 @@ public: cPluginLua(const AString & a_PluginDirectory, cDeadlockDetect & a_DeadlockDetect); - ~cPluginLua(); + virtual ~cPluginLua() override; virtual void OnDisable(void) override; virtual bool Load(void) override; diff --git a/src/BlockEntities/BrewingstandEntity.h b/src/BlockEntities/BrewingstandEntity.h index efdf72daf..a8891968a 100644 --- a/src/BlockEntities/BrewingstandEntity.h +++ b/src/BlockEntities/BrewingstandEntity.h @@ -40,7 +40,7 @@ public: /** Constructor used for normal operation */ cBrewingstandEntity(int a_BlockX, int a_BlockY, int a_BlockZ, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta, cWorld * a_World); - virtual ~cBrewingstandEntity(); + virtual ~cBrewingstandEntity() override; // cBlockEntity overrides: virtual void SendTo(cClientHandle & a_Client) override; diff --git a/src/BlockEntities/ChestEntity.h b/src/BlockEntities/ChestEntity.h index 8953644e6..9a10cd9a5 100644 --- a/src/BlockEntities/ChestEntity.h +++ b/src/BlockEntities/ChestEntity.h @@ -33,7 +33,7 @@ public: /** Constructor used for normal operation */ cChestEntity(int a_BlockX, int a_BlockY, int a_BlockZ, cWorld * a_World, BLOCKTYPE a_Type); - virtual ~cChestEntity(); + virtual ~cChestEntity() override; // cBlockEntity overrides: virtual void SendTo(cClientHandle & a_Client) override; diff --git a/src/BlockEntities/DropSpenserEntity.h b/src/BlockEntities/DropSpenserEntity.h index a009067f0..8efd7acf8 100644 --- a/src/BlockEntities/DropSpenserEntity.h +++ b/src/BlockEntities/DropSpenserEntity.h @@ -40,7 +40,7 @@ public: BLOCKENTITY_PROTODEF(cDropSpenserEntity) cDropSpenserEntity(BLOCKTYPE a_BlockType, int a_BlockX, int a_BlockY, int a_BlockZ, cWorld * a_World); - virtual ~cDropSpenserEntity(); + virtual ~cDropSpenserEntity() override; // cBlockEntity overrides: virtual bool Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk) override; diff --git a/src/BlockEntities/EnderChestEntity.h b/src/BlockEntities/EnderChestEntity.h index f599ad391..cb45f44b7 100644 --- a/src/BlockEntities/EnderChestEntity.h +++ b/src/BlockEntities/EnderChestEntity.h @@ -21,7 +21,7 @@ public: BLOCKENTITY_PROTODEF(cEnderChestEntity) cEnderChestEntity(int a_BlockX, int a_BlockY, int a_BlockZ, cWorld * a_World); - virtual ~cEnderChestEntity(); + virtual ~cEnderChestEntity() override; // cBlockEntity overrides: virtual bool UsedBy(cPlayer * a_Player) override; diff --git a/src/BlockEntities/FurnaceEntity.h b/src/BlockEntities/FurnaceEntity.h index a0cd54a37..c9252c39f 100644 --- a/src/BlockEntities/FurnaceEntity.h +++ b/src/BlockEntities/FurnaceEntity.h @@ -38,7 +38,7 @@ public: /** Constructor used for normal operation */ cFurnaceEntity(int a_BlockX, int a_BlockY, int a_BlockZ, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta, cWorld * a_World); - virtual ~cFurnaceEntity(); + virtual ~cFurnaceEntity() override; // cBlockEntity overrides: virtual void SendTo(cClientHandle & a_Client) override; diff --git a/src/BlockEntities/JukeboxEntity.h b/src/BlockEntities/JukeboxEntity.h index 6d9f90a2b..c76aa6507 100644 --- a/src/BlockEntities/JukeboxEntity.h +++ b/src/BlockEntities/JukeboxEntity.h @@ -20,7 +20,7 @@ public: BLOCKENTITY_PROTODEF(cJukeboxEntity) cJukeboxEntity(int a_BlockX, int a_BlockY, int a_BlockZ, cWorld * a_World); - virtual ~cJukeboxEntity(); + virtual ~cJukeboxEntity() override; // tolua_begin diff --git a/src/BlockEntities/NoteEntity.h b/src/BlockEntities/NoteEntity.h index 9b26f7141..7e92a7f06 100644 --- a/src/BlockEntities/NoteEntity.h +++ b/src/BlockEntities/NoteEntity.h @@ -34,7 +34,7 @@ public: /** Creates a new note entity. a_World may be nullptr */ cNoteEntity(int a_X, int a_Y, int a_Z, cWorld * a_World); - virtual ~cNoteEntity() {} + virtual ~cNoteEntity() override {} // tolua_begin diff --git a/src/Blocks/ClearMetaOnDrop.h b/src/Blocks/ClearMetaOnDrop.h index 91e932454..3a375e121 100644 --- a/src/Blocks/ClearMetaOnDrop.h +++ b/src/Blocks/ClearMetaOnDrop.h @@ -16,7 +16,7 @@ public: Base(a_BlockType) {} - virtual ~cClearMetaOnDrop() {} + virtual ~cClearMetaOnDrop() override {} virtual void ConvertToPickups(cItems & a_Pickups, NIBBLETYPE a_BlockMeta) override { a_Pickups.push_back(cItem(this->m_BlockType)); diff --git a/src/Blocks/MetaRotator.h b/src/Blocks/MetaRotator.h index 67066efff..61cd81ddc 100644 --- a/src/Blocks/MetaRotator.h +++ b/src/Blocks/MetaRotator.h @@ -29,7 +29,7 @@ public: Base(a_BlockType) {} - virtual ~cMetaRotator() {} + virtual ~cMetaRotator() override {} virtual NIBBLETYPE MetaRotateCCW(NIBBLETYPE a_Meta) override; virtual NIBBLETYPE MetaRotateCW(NIBBLETYPE a_Meta) override; diff --git a/src/ChunkSender.h b/src/ChunkSender.h index a7b1e104b..0946f4318 100644 --- a/src/ChunkSender.h +++ b/src/ChunkSender.h @@ -57,7 +57,7 @@ class cChunkSender: typedef cIsThread super; public: cChunkSender(cWorld & a_World); - ~cChunkSender(); + virtual ~cChunkSender() override; enum eChunkPriority { diff --git a/src/ClientHandle.h b/src/ClientHandle.h index 1953ab953..0b51c50cd 100644 --- a/src/ClientHandle.h +++ b/src/ClientHandle.h @@ -71,7 +71,7 @@ public: // tolua_export /** Creates a new client with the specified IP address in its description and the specified initial view distance. */ cClientHandle(const AString & a_IPString, int a_ViewDistance); - virtual ~cClientHandle(); + virtual ~cClientHandle() override; const AString & GetIPString(void) const { return m_IPString; } // tolua_export diff --git a/src/DeadlockDetect.h b/src/DeadlockDetect.h index ee6dc3e22..db77fa169 100644 --- a/src/DeadlockDetect.h +++ b/src/DeadlockDetect.h @@ -27,7 +27,7 @@ class cDeadlockDetect : public: cDeadlockDetect(void); - ~cDeadlockDetect(); + virtual ~cDeadlockDetect() override; /** Starts the detection. Hides cIsThread's Start, because we need some initialization */ bool Start(int a_IntervalSec); diff --git a/src/Entities/Pawn.h b/src/Entities/Pawn.h index e2444e9a0..e6aae4f49 100644 --- a/src/Entities/Pawn.h +++ b/src/Entities/Pawn.h @@ -22,7 +22,7 @@ public: CLASS_PROTODEF(cPawn) cPawn(eEntityType a_EntityType, double a_Width, double a_Height); - ~cPawn(); + virtual ~cPawn() override; virtual void Destroyed() override; virtual void Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk) override; diff --git a/src/Entities/Player.cpp b/src/Entities/Player.cpp index 7fa17f0f5..94398c258 100644 --- a/src/Entities/Player.cpp +++ b/src/Entities/Player.cpp @@ -74,8 +74,6 @@ cPlayer::cPlayer(cClientHandlePtr a_Client, const AString & a_PlayerName) : m_IsCrouched(false), m_IsSprinting(false), m_IsFlying(false), - m_IsSwimming(false), - m_IsSubmerged(false), m_IsFishing(false), m_CanFly(false), m_EatingFinishTick(-1), @@ -96,6 +94,9 @@ cPlayer::cPlayer(cClientHandlePtr a_Client, const AString & a_PlayerName) : { ASSERT(a_PlayerName.length() <= 16); // Otherwise this player could crash many clients... + m_IsSwimming = false; + m_IsSubmerged = false; + m_InventoryWindow = new cInventoryWindow(*this); m_CurrentWindow = m_InventoryWindow; m_InventoryWindow->OpenedByPlayer(*this); diff --git a/src/Entities/Player.h b/src/Entities/Player.h index 058ece26e..02f187e31 100644 --- a/src/Entities/Player.h +++ b/src/Entities/Player.h @@ -43,7 +43,7 @@ public: virtual bool Initialize(cWorld & a_World) override; - virtual ~cPlayer(); + virtual ~cPlayer() override; virtual void SpawnOn(cClientHandle & a_Client) override; @@ -645,8 +645,6 @@ protected: bool m_IsCrouched; bool m_IsSprinting; bool m_IsFlying; - bool m_IsSwimming; - bool m_IsSubmerged; bool m_IsFishing; bool m_CanFly; // If this is true the player can fly. Even if he is not in creative. diff --git a/src/Generating/BioGen.h b/src/Generating/BioGen.h index 576c6b83d..104916761 100644 --- a/src/Generating/BioGen.h +++ b/src/Generating/BioGen.h @@ -49,7 +49,7 @@ class cBioGenCache : public: cBioGenCache(cBiomeGenPtr a_BioGenToCache, size_t a_CacheSize); - virtual ~cBioGenCache(); + virtual ~cBioGenCache() override; protected: diff --git a/src/Generating/Caves.cpp b/src/Generating/Caves.cpp index 6dd0eb4b6..7057cd349 100644 --- a/src/Generating/Caves.cpp +++ b/src/Generating/Caves.cpp @@ -127,7 +127,7 @@ public: int m_BlockZ; cCaveSystem(int a_GridX, int a_GridZ, int a_OriginX, int a_OriginZ, int a_MaxOffset, int a_Size, cNoise & a_Noise); - ~cCaveSystem(); + virtual ~cCaveSystem() override; protected: int m_Size; diff --git a/src/Generating/Caves.h b/src/Generating/Caves.h index af5e3b5eb..cf47d9a92 100644 --- a/src/Generating/Caves.h +++ b/src/Generating/Caves.h @@ -69,7 +69,6 @@ class cStructGenWormNestCaves : public: cStructGenWormNestCaves(int a_Seed, int a_Size = 64, int a_Grid = 96, int a_MaxOffset = 128) : super(a_Seed, a_Grid, a_Grid, a_MaxOffset, a_MaxOffset, a_Size, a_Size, 100), - m_Noise(a_Seed), m_Size(a_Size), m_MaxOffset(a_MaxOffset), m_Grid(a_Grid) @@ -79,7 +78,6 @@ public: protected: class cCaveSystem; // fwd: Caves.cpp - cNoise m_Noise; int m_Size; // relative size of the cave systems' caves. Average number of blocks of each initial tunnel int m_MaxOffset; // maximum offset of the cave nest origin from the grid cell the nest belongs to int m_Grid; // average spacing of the nests diff --git a/src/Generating/ChunkGenerator.h b/src/Generating/ChunkGenerator.h index 5c778fda4..41390083f 100644 --- a/src/Generating/ChunkGenerator.h +++ b/src/Generating/ChunkGenerator.h @@ -109,7 +109,7 @@ public: cChunkGenerator (void); - ~cChunkGenerator(); + virtual ~cChunkGenerator() override; bool Start(cPluginInterface & a_PluginInterface, cChunkSink & a_ChunkSink, cIniFile & a_IniFile); void Stop(void); diff --git a/src/Generating/CompoGen.h b/src/Generating/CompoGen.h index b5108bac6..bc15a2dcb 100644 --- a/src/Generating/CompoGen.h +++ b/src/Generating/CompoGen.h @@ -116,7 +116,7 @@ class cCompoGenCache : { public: cCompoGenCache(cTerrainCompositionGenPtr a_Underlying, int a_CacheSize); // Doesn't take ownership of a_Underlying - ~cCompoGenCache(); + virtual ~cCompoGenCache() override; // cTerrainCompositionGen override: virtual void ComposeTerrain(cChunkDesc & a_ChunkDesc, const cChunkDesc::Shape & a_Shape) override; diff --git a/src/Generating/HeiGen.h b/src/Generating/HeiGen.h index 67c6c00cd..0f7b59093 100644 --- a/src/Generating/HeiGen.h +++ b/src/Generating/HeiGen.h @@ -29,7 +29,7 @@ class cHeiGenCache : { public: cHeiGenCache(cTerrainHeightGenPtr a_HeiGenToCache, size_t a_CacheSize); - ~cHeiGenCache(); + virtual ~cHeiGenCache() override; // cTerrainHeightGen overrides: virtual void GenHeightMap(int a_ChunkX, int a_ChunkZ, cChunkDef::HeightMap & a_HeightMap) override; diff --git a/src/Generating/MineShafts.cpp b/src/Generating/MineShafts.cpp index a9f2d1568..755fa23a3 100644 --- a/src/Generating/MineShafts.cpp +++ b/src/Generating/MineShafts.cpp @@ -1293,7 +1293,6 @@ cStructGenMineShafts::cStructGenMineShafts( int a_ChanceCorridor, int a_ChanceCrossing, int a_ChanceStaircase ) : super(a_Seed, a_GridSize, a_GridSize, a_MaxOffset, a_MaxOffset, a_MaxSystemSize, a_MaxSystemSize, 100), - m_Noise(a_Seed), m_GridSize(a_GridSize), m_MaxSystemSize(a_MaxSystemSize), m_ProbLevelCorridor(std::max(0, a_ChanceCorridor)), diff --git a/src/Generating/MineShafts.h b/src/Generating/MineShafts.h index 401b1d31e..83f60ec77 100644 --- a/src/Generating/MineShafts.h +++ b/src/Generating/MineShafts.h @@ -34,7 +34,6 @@ protected: friend class cMineShaftStaircase; class cMineShaftSystem; // fwd: MineShafts.cpp - cNoise m_Noise; int m_GridSize; ///< Average spacing of the systems int m_MaxSystemSize; ///< Maximum blcok size of a mineshaft system int m_ProbLevelCorridor; ///< Probability level of a branch object being the corridor diff --git a/src/Generating/Noise3DGenerator.h b/src/Generating/Noise3DGenerator.h index 1bbae2584..0b0730e21 100644 --- a/src/Generating/Noise3DGenerator.h +++ b/src/Generating/Noise3DGenerator.h @@ -27,7 +27,7 @@ class cNoise3DGenerator : public: cNoise3DGenerator(cChunkGenerator & a_ChunkGenerator); - virtual ~cNoise3DGenerator(); + virtual ~cNoise3DGenerator() override; virtual void Initialize(cIniFile & a_IniFile) override; virtual void GenerateBiomes(int a_ChunkX, int a_ChunkZ, cChunkDef::BiomeMap & a_BiomeMap) override; diff --git a/src/Generating/PrefabPiecePool.h b/src/Generating/PrefabPiecePool.h index ff0446b56..14df221c6 100644 --- a/src/Generating/PrefabPiecePool.h +++ b/src/Generating/PrefabPiecePool.h @@ -50,7 +50,7 @@ public: cPrefabPiecePool(const AString & a_FileName, bool a_LogWarnings); /** Destroys the pool, freeing all pieces. */ - ~cPrefabPiecePool(); + virtual ~cPrefabPiecePool() override; /** Removes and frees all pieces from this pool. */ void Clear(void); diff --git a/src/Generating/Ravines.cpp b/src/Generating/Ravines.cpp index 40022aefb..1dd58a7b8 100644 --- a/src/Generating/Ravines.cpp +++ b/src/Generating/Ravines.cpp @@ -82,7 +82,6 @@ protected: cStructGenRavines::cStructGenRavines(int a_Seed, int a_Size) : super(a_Seed, a_Size, a_Size, a_Size, a_Size, a_Size * 2, a_Size * 2, 100), - m_Noise(a_Seed), m_Size(a_Size) { } diff --git a/src/Generating/Ravines.h b/src/Generating/Ravines.h index 0bcdffa3b..5353978d0 100644 --- a/src/Generating/Ravines.h +++ b/src/Generating/Ravines.h @@ -26,7 +26,6 @@ public: protected: class cRavine; // fwd: Ravines.cpp - cNoise m_Noise; int m_Size; // Max size, in blocks, of the ravines generated diff --git a/src/Generating/RoughRavines.cpp b/src/Generating/RoughRavines.cpp index f6f984ab4..a9e9a97de 100644 --- a/src/Generating/RoughRavines.cpp +++ b/src/Generating/RoughRavines.cpp @@ -231,7 +231,6 @@ cRoughRavines::cRoughRavines( int a_GridSize, int a_MaxOffset ) : super(a_Seed, a_GridSize, a_GridSize, a_MaxOffset, a_MaxOffset, a_MaxSize, a_MaxSize, 64), - m_Seed(a_Seed), m_MaxSize(a_MaxSize), m_MinSize(a_MinSize), m_MaxCenterWidth(a_MaxCenterWidth), diff --git a/src/Generating/RoughRavines.h b/src/Generating/RoughRavines.h index a5ce13357..b326d7345 100644 --- a/src/Generating/RoughRavines.h +++ b/src/Generating/RoughRavines.h @@ -33,8 +33,6 @@ public: ); protected: - int m_Seed; - /** Maximum size of the ravine, in each of the X / Z axis */ int m_MaxSize; diff --git a/src/Generating/VillageGen.cpp b/src/Generating/VillageGen.cpp index 11617c9ec..1b6f012db 100644 --- a/src/Generating/VillageGen.cpp +++ b/src/Generating/VillageGen.cpp @@ -336,7 +336,7 @@ cVillageGen::cVillageGen( const AStringVector & a_PrefabsToLoad ) : super(a_Seed, a_GridSize, a_GridSize, a_MaxOffset, a_MaxOffset, a_MaxSize, a_MaxSize, 100), - m_Noise(a_Seed + 1000), + m_RandNoise(a_Seed + 1000), m_MaxDepth(a_MaxDepth), m_MaxSize(a_MaxSize), m_MinDensity(a_MinDensity), @@ -399,7 +399,7 @@ cGridStructGen::cStructurePtr cVillageGen::CreateStructure(int a_GridX, int a_Gr { return cStructurePtr(); } - auto rnd = m_Noise.IntNoise2DInt(a_OriginX, a_OriginZ) / 11; + auto rnd = m_RandNoise.IntNoise2DInt(a_OriginX, a_OriginZ) / 11; auto pool = availablePools[static_cast(rnd) % availablePools.size()]; rnd /= 137; diff --git a/src/Generating/VillageGen.h b/src/Generating/VillageGen.h index df68d407d..a7fc1b255 100644 --- a/src/Generating/VillageGen.h +++ b/src/Generating/VillageGen.h @@ -47,7 +47,7 @@ protected: typedef std::vector > cVillagePiecePools; /** The noise used for generating random numbers */ - cNoise m_Noise; + cNoise m_RandNoise; /** Maximum depth of the generator tree */ int m_MaxDepth; diff --git a/src/HTTP/HTTPServerConnection.h b/src/HTTP/HTTPServerConnection.h index 4390471d0..22e243d93 100644 --- a/src/HTTP/HTTPServerConnection.h +++ b/src/HTTP/HTTPServerConnection.h @@ -33,7 +33,7 @@ public: cHTTPServerConnection(cHTTPServer & a_HTTPServer); // Force a virtual destructor in all descendants - virtual ~cHTTPServerConnection(); + virtual ~cHTTPServerConnection() override; /** Sends HTTP status code together with a_Reason (used for HTTP errors). Sends the a_Reason as the body as well, so that browsers display it. diff --git a/src/HTTP/SslHTTPServerConnection.h b/src/HTTP/SslHTTPServerConnection.h index eceb80fb7..0f56d082f 100644 --- a/src/HTTP/SslHTTPServerConnection.h +++ b/src/HTTP/SslHTTPServerConnection.h @@ -26,7 +26,7 @@ public: Sends the specified cert as the server certificate, uses the private key for decryption. */ cSslHTTPServerConnection(cHTTPServer & a_HTTPServer, const cX509CertPtr & a_Cert, const cCryptoKeyPtr & a_PrivateKey); - ~cSslHTTPServerConnection(); + virtual ~cSslHTTPServerConnection() override; protected: cBufferedSslContext m_Ssl; diff --git a/src/IniFile.h b/src/IniFile.h index 802eb9982..3a5359d99 100644 --- a/src/IniFile.h +++ b/src/IniFile.h @@ -71,7 +71,7 @@ public: cIniFile(void); // tolua_end - virtual ~cIniFile() = default; + virtual ~cIniFile() override = default; virtual std::vector> GetValues(AString a_keyName) override; diff --git a/src/Inventory.h b/src/Inventory.h index 2bcc66ec1..ec159ec8e 100644 --- a/src/Inventory.h +++ b/src/Inventory.h @@ -54,7 +54,7 @@ public: cInventory(cPlayer & a_Owner); - virtual ~cInventory() {} + virtual ~cInventory() override {} // tolua_begin diff --git a/src/LightingThread.h b/src/LightingThread.h index d95214a3c..2417ca706 100644 --- a/src/LightingThread.h +++ b/src/LightingThread.h @@ -54,7 +54,7 @@ class cLightingThread : public: cLightingThread(void); - ~cLightingThread(); + virtual ~cLightingThread() override; bool Start(cWorld * a_World); diff --git a/src/Mobs/Horse.cpp b/src/Mobs/Horse.cpp index ab06704d6..978471b8d 100644 --- a/src/Mobs/Horse.cpp +++ b/src/Mobs/Horse.cpp @@ -24,7 +24,7 @@ cHorse::cHorse(int Type, int Color, int Style, int TameTimes) : m_TimesToTame(TameTimes), m_TameAttemptTimes(0), m_RearTickCount(0), - m_Speed(20.0) + m_MaxSpeed(20.0) { } @@ -183,6 +183,6 @@ void cHorse::HandleSpeedFromAttachee(float a_Forward, float a_Sideways) { if ((m_bIsTame) && (m_bIsSaddled)) { - super::HandleSpeedFromAttachee(a_Forward * m_Speed, a_Sideways * m_Speed); + super::HandleSpeedFromAttachee(a_Forward * m_MaxSpeed, a_Sideways * m_MaxSpeed); } } diff --git a/src/Mobs/Horse.h b/src/Mobs/Horse.h index 7afa5bf29..82026a0ee 100644 --- a/src/Mobs/Horse.h +++ b/src/Mobs/Horse.h @@ -44,7 +44,7 @@ private: bool m_bHasChest, m_bIsEating, m_bIsRearing, m_bIsMouthOpen, m_bIsTame, m_bIsSaddled; int m_Type, m_Color, m_Style, m_Armour, m_TimesToTame, m_TameAttemptTimes, m_RearTickCount; - float m_Speed; + float m_MaxSpeed; } ; diff --git a/src/Mobs/Monster.h b/src/Mobs/Monster.h index 3aaadb57f..cb1e73942 100644 --- a/src/Mobs/Monster.h +++ b/src/Mobs/Monster.h @@ -44,7 +44,7 @@ public: */ cMonster(const AString & a_ConfigName, eMonsterType a_MobType, const AString & a_SoundHurt, const AString & a_SoundDeath, double a_Width, double a_Height); - ~cMonster(); + virtual ~cMonster() override; virtual void Destroyed() override; diff --git a/src/OSSupport/ServerHandleImpl.h b/src/OSSupport/ServerHandleImpl.h index dbb18fc6d..8a22df18b 100644 --- a/src/OSSupport/ServerHandleImpl.h +++ b/src/OSSupport/ServerHandleImpl.h @@ -39,7 +39,7 @@ class cServerHandleImpl: public: /** Closes the server, dropping all the connections. */ - ~cServerHandleImpl(); + virtual ~cServerHandleImpl() override; /** Creates a new server instance listening on the specified port. Both IPv4 and IPv6 interfaces are used, if possible. diff --git a/src/OSSupport/TCPLinkImpl.h b/src/OSSupport/TCPLinkImpl.h index b54c1a2cc..d582e2f8d 100644 --- a/src/OSSupport/TCPLinkImpl.h +++ b/src/OSSupport/TCPLinkImpl.h @@ -44,7 +44,7 @@ public: cTCPLinkImpl(evutil_socket_t a_Socket, cCallbacksPtr a_LinkCallbacks, cServerHandleImplPtr a_Server, const sockaddr * a_Address, socklen_t a_AddrLen); /** Destroys the LibEvent handle representing the link. */ - ~cTCPLinkImpl(); + virtual ~cTCPLinkImpl() override; /** Queues a connection request to the specified host. a_ConnectCallbacks must be valid. diff --git a/src/OSSupport/UDPEndpointImpl.h b/src/OSSupport/UDPEndpointImpl.h index 0e28d0b13..56116df17 100644 --- a/src/OSSupport/UDPEndpointImpl.h +++ b/src/OSSupport/UDPEndpointImpl.h @@ -35,7 +35,7 @@ public: If a_Port is 0, the OS is free to assign any port number it likes to the endpoint. */ cUDPEndpointImpl(UInt16 a_Port, cUDPEndpoint::cCallbacks & a_Callbacks); - ~cUDPEndpointImpl(); + virtual ~cUDPEndpointImpl() override; // cUDPEndpoint overrides: virtual void Close(void) override; diff --git a/src/OverridesSettingsRepository.h b/src/OverridesSettingsRepository.h index 62c1ec83d..d168b7b72 100644 --- a/src/OverridesSettingsRepository.h +++ b/src/OverridesSettingsRepository.h @@ -11,7 +11,7 @@ class cOverridesSettingsRepository : public cSettingsRepositoryInterface public: cOverridesSettingsRepository(std::unique_ptr a_Main, std::unique_ptr a_Overrides); - virtual ~cOverridesSettingsRepository() = default; + virtual ~cOverridesSettingsRepository() override = default; virtual bool KeyExists(const AString keyname) const override; diff --git a/src/PolarSSL++/BlockingSslClientSocket.h b/src/PolarSSL++/BlockingSslClientSocket.h index bc7cbe039..d3b12037b 100644 --- a/src/PolarSSL++/BlockingSslClientSocket.h +++ b/src/PolarSSL++/BlockingSslClientSocket.h @@ -23,7 +23,7 @@ class cBlockingSslClientSocket : public: cBlockingSslClientSocket(void); - ~cBlockingSslClientSocket(void) + virtual ~cBlockingSslClientSocket(void) override { Disconnect(); } diff --git a/src/Protocol/Authenticator.h b/src/Protocol/Authenticator.h index a8c551fc7..c97bf44a8 100644 --- a/src/Protocol/Authenticator.h +++ b/src/Protocol/Authenticator.h @@ -37,7 +37,7 @@ class cAuthenticator : public: cAuthenticator(void); - ~cAuthenticator(); + virtual ~cAuthenticator() override; /** (Re-)read server and address from INI: */ void ReadSettings(cSettingsRepositoryInterface & a_Settings); diff --git a/src/Protocol/MojangAPI.cpp b/src/Protocol/MojangAPI.cpp index 0edb9f33e..4d5361479 100644 --- a/src/Protocol/MojangAPI.cpp +++ b/src/Protocol/MojangAPI.cpp @@ -215,7 +215,7 @@ public: { } - ~cUpdateThread() + virtual ~cUpdateThread() override { // Notify the thread that it should stop: m_ShouldTerminate = true; diff --git a/src/Protocol/ProtocolRecognizer.h b/src/Protocol/ProtocolRecognizer.h index dd681afda..921efcea7 100644 --- a/src/Protocol/ProtocolRecognizer.h +++ b/src/Protocol/ProtocolRecognizer.h @@ -45,7 +45,7 @@ public: } ; cProtocolRecognizer(cClientHandle * a_Client); - virtual ~cProtocolRecognizer(); + virtual ~cProtocolRecognizer() override; /** Translates protocol version number into protocol version text: 49 -> "1.4.4" */ static AString GetVersionTextFromInt(int a_ProtocolVersion); diff --git a/src/Simulator/FireSimulator.h b/src/Simulator/FireSimulator.h index bda02cbf7..204306f61 100644 --- a/src/Simulator/FireSimulator.h +++ b/src/Simulator/FireSimulator.h @@ -20,7 +20,7 @@ class cFireSimulator : { public: cFireSimulator(cWorld & a_World, cIniFile & a_IniFile); - ~cFireSimulator(); + virtual ~cFireSimulator() override; virtual void Simulate(float a_Dt) override { UNUSED(a_Dt);} // not used virtual void SimulateChunk(std::chrono::milliseconds a_Dt, int a_ChunkX, int a_ChunkZ, cChunk * a_Chunk) override; diff --git a/src/Simulator/IncrementalRedstoneSimulator/TrappedChestHandler.h b/src/Simulator/IncrementalRedstoneSimulator/TrappedChestHandler.h index 6cc56d0cd..561c32d19 100644 --- a/src/Simulator/IncrementalRedstoneSimulator/TrappedChestHandler.h +++ b/src/Simulator/IncrementalRedstoneSimulator/TrappedChestHandler.h @@ -42,7 +42,7 @@ public: { } - virtual ~cGetTrappedChestPlayers() + virtual ~cGetTrappedChestPlayers() override { } diff --git a/src/UI/ChestWindow.h b/src/UI/ChestWindow.h index bf8ef4f2f..8fe165920 100644 --- a/src/UI/ChestWindow.h +++ b/src/UI/ChestWindow.h @@ -25,7 +25,7 @@ public: cChestWindow(cChestEntity * a_PrimaryChest, cChestEntity * a_SecondaryChest); - ~cChestWindow(); + virtual ~cChestWindow() override; virtual bool ClosedByPlayer(cPlayer & a_Player, bool a_CanRefuse) override; diff --git a/src/UI/EnderChestWindow.h b/src/UI/EnderChestWindow.h index 006a490bf..05f8ca49f 100644 --- a/src/UI/EnderChestWindow.h +++ b/src/UI/EnderChestWindow.h @@ -24,7 +24,7 @@ class cEnderChestWindow : public: cEnderChestWindow(cEnderChestEntity * a_EnderChest); - ~cEnderChestWindow(); + virtual ~cEnderChestWindow() override; virtual void DistributeStack(cItem & a_ItemStack, int a_Slot, cPlayer & a_Player, cSlotArea * a_ClickedArea, bool a_ShouldApply) override; diff --git a/src/UI/MinecartWithChestWindow.h b/src/UI/MinecartWithChestWindow.h index 5e3c28512..2ce728399 100644 --- a/src/UI/MinecartWithChestWindow.h +++ b/src/UI/MinecartWithChestWindow.h @@ -53,7 +53,7 @@ public: } - ~cMinecartWithChestWindow() + virtual ~cMinecartWithChestWindow() override { m_ChestCart->GetWorld()->BroadcastSoundEffect("block.chest.close", m_ChestCart->GetPosX(), m_ChestCart->GetPosY(), m_ChestCart->GetPosZ(), 1, 1); } diff --git a/src/UI/SlotArea.h b/src/UI/SlotArea.h index a25de0319..005ba6e7f 100644 --- a/src/UI/SlotArea.h +++ b/src/UI/SlotArea.h @@ -178,7 +178,7 @@ class cSlotAreaItemGrid : public: cSlotAreaItemGrid(cItemGrid & a_ItemGrid, cWindow & a_ParentWindow); - virtual ~cSlotAreaItemGrid(); + virtual ~cSlotAreaItemGrid() override; virtual const cItem * GetSlot(int a_SlotNum, cPlayer & a_Player) const override; virtual void SetSlot(int a_SlotNum, cPlayer & a_Player, const cItem & a_Item) override; @@ -324,7 +324,7 @@ class cSlotAreaBeacon : public: cSlotAreaBeacon(cBeaconEntity * a_Beacon, cWindow & a_ParentWindow); - virtual ~cSlotAreaBeacon(); + virtual ~cSlotAreaBeacon() override; static bool IsPlaceableItem(short a_ItemType); @@ -436,7 +436,7 @@ class cSlotAreaFurnace : public: cSlotAreaFurnace(cFurnaceEntity * a_Furnace, cWindow & a_ParentWindow); - virtual ~cSlotAreaFurnace(); + virtual ~cSlotAreaFurnace() override; virtual void Clicked(cPlayer & a_Player, int a_SlotNum, eClickAction a_ClickAction, const cItem & a_ClickedItem) override; virtual void DistributeStack(cItem & a_ItemStack, cPlayer & a_Player, bool a_ShouldApply, bool a_KeepEmptySlots, bool a_BackFill) override; @@ -466,7 +466,7 @@ class cSlotAreaBrewingstand : public: cSlotAreaBrewingstand(cBrewingstandEntity * a_Brewingstand, cWindow & a_ParentWindow); - virtual ~cSlotAreaBrewingstand(); + virtual ~cSlotAreaBrewingstand() override; virtual void Clicked(cPlayer & a_Player, int a_SlotNum, eClickAction a_ClickAction, const cItem & a_ClickedItem) override; virtual void DistributeStack(cItem & a_ItemStack, cPlayer & a_Player, bool a_ShouldApply, bool a_KeepEmptySlots, bool a_BackFill) override; diff --git a/src/WebAdmin.h b/src/WebAdmin.h index 50a0487b0..a4effdbeb 100644 --- a/src/WebAdmin.h +++ b/src/WebAdmin.h @@ -157,7 +157,7 @@ public: cWebAdmin(void); - virtual ~cWebAdmin(); + virtual ~cWebAdmin() override; /** Initializes the object. Returns true if successfully initialized and ready to start */ bool Init(void); diff --git a/src/World.h b/src/World.h index 196a1b2e1..6ad476b94 100644 --- a/src/World.h +++ b/src/World.h @@ -1034,7 +1034,7 @@ private: cWorld(const AString & a_WorldName, eDimension a_Dimension = dimOverworld, const AString & a_LinkedOverworldName = ""); - virtual ~cWorld(); + virtual ~cWorld() override; void Tick(std::chrono::milliseconds a_Dt, std::chrono::milliseconds a_LastTickDurationMSec); diff --git a/src/WorldStorage/WSSAnvil.h b/src/WorldStorage/WSSAnvil.h index 0bd12af57..a4527bfcd 100755 --- a/src/WorldStorage/WSSAnvil.h +++ b/src/WorldStorage/WSSAnvil.h @@ -51,7 +51,7 @@ class cWSSAnvil : public: cWSSAnvil(cWorld * a_World, int a_CompressionFactor); - virtual ~cWSSAnvil(); + virtual ~cWSSAnvil() override; protected: diff --git a/src/WorldStorage/WorldStorage.h b/src/WorldStorage/WorldStorage.h index e171aad43..3afa88ecd 100644 --- a/src/WorldStorage/WorldStorage.h +++ b/src/WorldStorage/WorldStorage.h @@ -62,7 +62,7 @@ class cWorldStorage : public: cWorldStorage(void); - ~cWorldStorage(); + virtual ~cWorldStorage() override; /** Queues a chunk to be loaded, asynchronously. The callback, if specified, will be called with the result of the load operation. */