diff options
Diffstat (limited to 'src/Generating/VillageGen.cpp')
-rw-r--r-- | src/Generating/VillageGen.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/Generating/VillageGen.cpp b/src/Generating/VillageGen.cpp index 27146e757..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<const cPrefab &>(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<const cPrefab &>(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<const cPrefab &>((*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<const cPrefab &>(a_PlacedPieces[i]->GetPiece())).ShouldMoveToGround() // It attaches strictly by connectors ) { a_PlacedPieces[i]->MoveToGroundBy(a_HeightDifference); @@ -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<size_t>(rnd) % ARRAYCOUNT(g_PlainsVillagePools)]; + cVillagePiecePool * DesertVillage = g_DesertVillagePools[static_cast<size_t>(rnd) % ARRAYCOUNT(g_DesertVillagePools)]; for (size_t i = 0; i < ARRAYCOUNT(Biomes); i++) { switch (Biomes[i]) |