diff --git a/include/world/vs_chunk_manager.h b/include/world/vs_chunk_manager.h index 0b09db3..35ac18a 100644 --- a/include/world/vs_chunk_manager.h +++ b/include/world/vs_chunk_manager.h @@ -125,7 +125,7 @@ class VSChunkManager : public IVSDrawable bool shouldReinitializeChunks() const; - bool isLocationInBounds(const glm::ivec3& location) const; + bool isLocationInBounds(const glm::vec3& location) const; VSTraceResult lineTrace(const glm::vec3& start, const glm::vec3& end) const; diff --git a/source/world/vs_chunk_manager.cpp b/source/world/vs_chunk_manager.cpp index 78ce6fe..9fa7149 100644 --- a/source/world/vs_chunk_manager.cpp +++ b/source/world/vs_chunk_manager.cpp @@ -509,7 +509,7 @@ bool VSChunkManager::shouldReinitializeChunks() const return bShouldReinitializeChunks.load(); } -bool VSChunkManager::isLocationInBounds(const glm::ivec3& location) const +bool VSChunkManager::isLocationInBounds(const glm::vec3& location) const { return ( (location.x >= -worldSizeHalf.x && location.x < worldSizeHalf.x) && @@ -531,7 +531,7 @@ VSChunkManager::lineTrace(const glm::vec3& start, const glm::vec3& end) const while (!bShouldReinitializeChunks && t < maxRayLength) { const auto samplePos = start + rayDir * t; - if (isLocationInBounds(samplePos)) + if (!bShouldReinitializeChunks && isLocationInBounds(samplePos)) { const auto blockSample = getBlock(samplePos); if (blockSample != VS_DEFAULT_BLOCK_ID)