summaryrefslogtreecommitdiffstats
path: root/src/Chunk.cpp
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2019-09-27 17:51:44 +0200
committerpeterbell10 <peterbell10@live.co.uk>2019-09-27 17:51:44 +0200
commit180a43d09721a32ad502f5e583d3b2d797501c00 (patch)
tree3b70a9188246ce86b3846c5d9d783171efa1dec3 /src/Chunk.cpp
parentFix clang8.0 build (#4399) (diff)
downloadcuberite-180a43d09721a32ad502f5e583d3b2d797501c00.tar
cuberite-180a43d09721a32ad502f5e583d3b2d797501c00.tar.gz
cuberite-180a43d09721a32ad502f5e583d3b2d797501c00.tar.bz2
cuberite-180a43d09721a32ad502f5e583d3b2d797501c00.tar.lz
cuberite-180a43d09721a32ad502f5e583d3b2d797501c00.tar.xz
cuberite-180a43d09721a32ad502f5e583d3b2d797501c00.tar.zst
cuberite-180a43d09721a32ad502f5e583d3b2d797501c00.zip
Diffstat (limited to '')
-rw-r--r--src/Chunk.cpp12
1 files changed, 6 insertions, 6 deletions
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<size_t>(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<int>(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<int>(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<size_t>(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<size_t>(MakeIndex(a_BlockEntity->GetRelX(), a_BlockEntity->GetPosY(), a_BlockEntity->GetRelZ()));
+ m_BlockEntities.erase(idx);
}