From 2bb25b8afab365da8a8f3db15d742b1ec12c2903 Mon Sep 17 00:00:00 2001 From: tycho Date: Tue, 19 May 2015 15:21:29 +0100 Subject: Fixed some more warnings --- src/Generating/VillageGen.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/Generating/VillageGen.cpp') diff --git a/src/Generating/VillageGen.cpp b/src/Generating/VillageGen.cpp index a3f8caa46..8f0bc13ef 100644 --- a/src/Generating/VillageGen.cpp +++ b/src/Generating/VillageGen.cpp @@ -389,8 +389,8 @@ cGridStructGen::cStructurePtr cVillageGen::CreateStructure(int a_GridX, int a_Gr BLOCKTYPE RoadBlock = E_BLOCK_GRAVEL; BLOCKTYPE WaterRoadBlock = E_BLOCK_PLANKS; int rnd = m_Noise.IntNoise2DInt(a_OriginX, a_OriginZ) / 11; - cVillagePiecePool * PlainsVillage = g_PlainsVillagePools[rnd % ARRAYCOUNT(g_PlainsVillagePools)]; - cVillagePiecePool * DesertVillage = g_DesertVillagePools[rnd % ARRAYCOUNT(g_DesertVillagePools)]; + cVillagePiecePool * PlainsVillage = g_PlainsVillagePools[static_cast(rnd) % ARRAYCOUNT(g_PlainsVillagePools)]; + cVillagePiecePool * DesertVillage = g_DesertVillagePools[static_cast(rnd) % ARRAYCOUNT(g_DesertVillagePools)]; for (size_t i = 0; i < ARRAYCOUNT(Biomes); i++) { switch (Biomes[i]) -- cgit v1.2.3 From dae9e5792a4f030ae9e748548a16a89790fbd311 Mon Sep 17 00:00:00 2001 From: tycho Date: Sun, 24 May 2015 12:56:56 +0100 Subject: Made -Weverything an error. --- src/Generating/VillageGen.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/Generating/VillageGen.cpp') diff --git a/src/Generating/VillageGen.cpp b/src/Generating/VillageGen.cpp index c0f1d4c8f..488497ac1 100644 --- a/src/Generating/VillageGen.cpp +++ b/src/Generating/VillageGen.cpp @@ -93,7 +93,7 @@ public: return 0; } - return ((const cPrefab &)a_NewPiece).GetPieceWeight(a_PlacedPiece, a_ExistingConnector); + return static_cast(a_NewPiece).GetPieceWeight(a_PlacedPiece, a_ExistingConnector); } }; @@ -141,7 +141,7 @@ public: // If the central piece should be moved to ground, move it, and // check all of its dependents and move those that are strictly connector-driven based on its new Y coord: - if (((cPrefab &)m_Pieces[0]->GetPiece()).ShouldMoveToGround()) + if (static_cast(m_Pieces[0]->GetPiece()).ShouldMoveToGround()) { int OrigPosY = m_Pieces[0]->GetCoords().y; PlacePieceOnGround(*m_Pieces[0]); @@ -197,7 +197,7 @@ protected: m_HeightGen->GenHeightMap(a_Chunk.GetChunkX(), a_Chunk.GetChunkZ(), HeightMap); for (cPlacedPieces::iterator itr = m_Pieces.begin(), end = m_Pieces.end(); itr != end; ++itr) { - cPrefab & Prefab = (cPrefab &)((*itr)->GetPiece()); + const cPrefab & Prefab = static_cast((*itr)->GetPiece()); if ((*itr)->GetPiece().GetSize().y == 1) { // It's a road, special handling (change top terrain blocks to m_RoadBlock) @@ -319,7 +319,7 @@ protected: { if ( (a_PlacedPieces[i]->GetParent() == Pivot) && // It is a direct dependant of the pivot - !((const cPrefab &)a_PlacedPieces[i]->GetPiece()).ShouldMoveToGround() // It attaches strictly by connectors + !(static_cast(a_PlacedPieces[i]->GetPiece())).ShouldMoveToGround() // It attaches strictly by connectors ) { a_PlacedPieces[i]->MoveToGroundBy(a_HeightDifference); -- cgit v1.2.3