diff --git a/game/level.cc b/game/level.cc index 43067c6..f70fb63 100644 --- a/game/level.cc +++ b/game/level.cc @@ -167,7 +167,7 @@ std::vector Level::getSurroundingChunks() { if (zEnd >= chunks.at(0).size()) { zEnd = chunks.at(0).size()-1; } - std::vector vector = std::vector((2*renderDistance)*(2*renderDistance)); + std::vector vector = std::vector((xEnd - xStart + 1)*(zEnd - zStart + 1)); int counter = 0; for(unsigned int i = xStart; i<=xEnd; i++) { for(unsigned int j = zStart; j<=zEnd; j++) {