From 180a43d09721a32ad502f5e583d3b2d797501c00 Mon Sep 17 00:00:00 2001 From: Mattes D Date: Fri, 27 Sep 2019 17:51:44 +0200 Subject: Fixed MSVC warnings (#4400) --- src/Chunk.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/Chunk.cpp') diff --git a/src/Chunk.cpp b/src/Chunk.cpp index 7a95bceed..9b9c881b7 100644 --- a/src/Chunk.cpp +++ b/src/Chunk.cpp @@ -458,7 +458,7 @@ void cChunk::WriteBlockArea(cBlockArea & a_Area, int a_MinBlockX, int a_MinBlock continue; } // This block entity is inside the chunk, clone it (and remove any that is there currently): - auto idx = MakeIndex(posX - m_PosX * cChunkDef::Width, posY, posZ - m_PosZ * cChunkDef::Width); + auto idx = static_cast(MakeIndex(posX - m_PosX * cChunkDef::Width, posY, posZ - m_PosZ * cChunkDef::Width)); auto itr = m_BlockEntities.find(idx); if (itr != m_BlockEntities.end()) { @@ -1421,7 +1421,7 @@ void cChunk::CreateBlockEntities(void) if (cBlockEntity::IsBlockEntityBlockType(BlockType)) { auto RelPos = IndexToCoordinate(BlockIdx); - RelPos.y += SectionIdx * cChunkData::SectionHeight; + RelPos.y += static_cast(SectionIdx * cChunkData::SectionHeight); auto WorldPos = RelativeToAbsolute(RelPos, m_PosX, m_PosZ); if (!HasBlockEntityAt(WorldPos)) @@ -1461,7 +1461,7 @@ void cChunk::WakeUpSimulators(void) auto WorldPos = [&] { auto RelPos = IndexToCoordinate(BlockIdx); - RelPos.y += SectionIdx * cChunkData::SectionHeight; + RelPos.y += static_cast(SectionIdx * cChunkData::SectionHeight); return RelativeToAbsolute(RelPos, m_PosX, m_PosZ); }; @@ -1761,7 +1761,7 @@ cBlockEntity * cChunk::GetBlockEntity(int a_BlockX, int a_BlockY, int a_BlockZ) return nullptr; } - auto itr = m_BlockEntities.find(MakeIndexNoCheck(RelX, a_BlockY, RelZ)); + auto itr = m_BlockEntities.find(static_cast(MakeIndexNoCheck(RelX, a_BlockY, RelZ))); return (itr == m_BlockEntities.end()) ? nullptr : itr->second; } @@ -1921,8 +1921,8 @@ void cChunk::RemoveBlockEntity(cBlockEntity * a_BlockEntity) { MarkDirty(); ASSERT(a_BlockEntity != nullptr); - int Idx = MakeIndex(a_BlockEntity->GetRelX(), a_BlockEntity->GetPosY(), a_BlockEntity->GetRelZ()); - m_BlockEntities.erase(Idx); + auto idx = static_cast(MakeIndex(a_BlockEntity->GetRelX(), a_BlockEntity->GetPosY(), a_BlockEntity->GetRelZ())); + m_BlockEntities.erase(idx); } -- cgit v1.2.3