summaryrefslogtreecommitdiffstats
path: root/source/WorldStorage
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--source/WorldStorage/WSSAnvil.cpp5
-rw-r--r--source/WorldStorage/WSSCompact.cpp4
2 files changed, 5 insertions, 4 deletions
diff --git a/source/WorldStorage/WSSAnvil.cpp b/source/WorldStorage/WSSAnvil.cpp
index 1204db282..70e280a57 100644
--- a/source/WorldStorage/WSSAnvil.cpp
+++ b/source/WorldStorage/WSSAnvil.cpp
@@ -388,9 +388,10 @@ bool cWSSAnvil::SetChunkData(const cChunkCoords & a_Chunk, const AString & a_Dat
cWSSAnvil::cMCAFile * cWSSAnvil::LoadMCAFile(const cChunkCoords & a_Chunk)
{
// ASSUME m_CS is locked
+ ASSERT(m_CS.IsLocked());
- const int RegionX = (int)(floorf((float)a_Chunk.m_ChunkX / 32.0f));
- const int RegionZ = (int)(floorf((float)a_Chunk.m_ChunkZ / 32.0f));
+ const int RegionX = FAST_FLOOR_DIV(a_Chunk.m_ChunkX, 32);
+ const int RegionZ = FAST_FLOOR_DIV(a_Chunk.m_ChunkZ, 32);
// Is it already cached?
for (cMCAFiles::iterator itr = m_Files.begin(); itr != m_Files.end(); ++itr)
diff --git a/source/WorldStorage/WSSCompact.cpp b/source/WorldStorage/WSSCompact.cpp
index 87cf1d930..1d873add6 100644
--- a/source/WorldStorage/WSSCompact.cpp
+++ b/source/WorldStorage/WSSCompact.cpp
@@ -171,8 +171,8 @@ cWSSCompact::cPAKFile * cWSSCompact::LoadPAKFile(const cChunkCoords & a_Chunk)
// ASSUMES that m_CS has been locked
// We need to retain this weird conversion code, because some edge chunks are in the wrong PAK file
- const int LayerX = (int)(floorf((float)a_Chunk.m_ChunkX / 32.0f));
- const int LayerZ = (int)(floorf((float)a_Chunk.m_ChunkZ / 32.0f));
+ const int LayerX = FAST_FLOOR_DIV(a_Chunk.m_ChunkX, 32);
+ const int LayerZ = FAST_FLOOR_DIV(a_Chunk.m_ChunkZ, 32);
// Is it already cached?
for (cPAKFiles::iterator itr = m_PAKFiles.begin(); itr != m_PAKFiles.end(); ++itr)