summaryrefslogtreecommitdiffstats
path: root/src/ChunkDef.h
diff options
context:
space:
mode:
authorpeterbell10 <peterbell10@live.co.uk>2018-07-23 20:12:51 +0200
committerGitHub <noreply@github.com>2018-07-23 20:12:51 +0200
commit31a11a6df4922b590a50a5ff3d3c00d42a45599d (patch)
treee495de40981de4fd89bf4b652a13fe1dcec723d7 /src/ChunkDef.h
parentcPawn: Reset last ground height in ResetPosition (#4261) (diff)
downloadcuberite-31a11a6df4922b590a50a5ff3d3c00d42a45599d.tar
cuberite-31a11a6df4922b590a50a5ff3d3c00d42a45599d.tar.gz
cuberite-31a11a6df4922b590a50a5ff3d3c00d42a45599d.tar.bz2
cuberite-31a11a6df4922b590a50a5ff3d3c00d42a45599d.tar.lz
cuberite-31a11a6df4922b590a50a5ff3d3c00d42a45599d.tar.xz
cuberite-31a11a6df4922b590a50a5ff3d3c00d42a45599d.tar.zst
cuberite-31a11a6df4922b590a50a5ff3d3c00d42a45599d.zip
Diffstat (limited to '')
-rw-r--r--src/ChunkDef.h14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/ChunkDef.h b/src/ChunkDef.h
index bdba4061f..3807ae1aa 100644
--- a/src/ChunkDef.h
+++ b/src/ChunkDef.h
@@ -207,19 +207,19 @@ public:
}
- inline static Vector3i IndexToCoordinate( unsigned int index)
+ inline static Vector3i IndexToCoordinate(size_t index)
{
#if AXIS_ORDER == AXIS_ORDER_XZY
return Vector3i( // 1.2
- index % cChunkDef::Width, // X
- index / (cChunkDef::Width * cChunkDef::Width), // Y
- (index / cChunkDef::Width) % cChunkDef::Width // Z
+ static_cast<int>(index % cChunkDef::Width), // X
+ static_cast<int>(index / (cChunkDef::Width * cChunkDef::Width)), // Y
+ static_cast<int>((index / cChunkDef::Width) % cChunkDef::Width) // Z
);
#elif AXIS_ORDER == AXIS_ORDER_YZX
return Vector3i( // 1.1
- index / (cChunkDef::Height * cChunkDef::Width), // X
- index % cChunkDef::Height, // Y
- (index / cChunkDef::Height) % cChunkDef::Width // Z
+ static_cast<int>(index / (cChunkDef::Height * cChunkDef::Width)), // X
+ static_cast<int>(index % cChunkDef::Height), // Y
+ static_cast<int>((index / cChunkDef::Height) % cChunkDef::Width) // Z
);
#endif
}