From 9ea16300570804a8dc8fc356ab2d841640662c0e Mon Sep 17 00:00:00 2001 From: Faerbit Date: Thu, 28 May 2015 11:16:30 +0200 Subject: [PATCH] Fixed a bug in getSurroundingChunks. --- game/level.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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++) {