From 81c9853fe96c45d9224b8b3711962d63afdf1813 Mon Sep 17 00:00:00 2001 From: scrawl Date: Wed, 8 Mar 2017 18:11:09 +0100 Subject: [PATCH] Fix handling in getBlendmaps when the chunk is >1 ESM::Cell --- components/esmterrain/storage.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/components/esmterrain/storage.cpp b/components/esmterrain/storage.cpp index 8009f48ad..1f4d1b7cf 100644 --- a/components/esmterrain/storage.cpp +++ b/components/esmterrain/storage.cpp @@ -324,7 +324,12 @@ namespace ESMTerrain --cellX; x += ESM::Land::LAND_TEXTURE_SIZE; } - if (y >= ESM::Land::LAND_TEXTURE_SIZE) // Y appears to be wrapped from the other side because why the hell not? + while (x >= ESM::Land::LAND_TEXTURE_SIZE) + { + ++cellX; + x -= ESM::Land::LAND_TEXTURE_SIZE; + } + while (y >= ESM::Land::LAND_TEXTURE_SIZE) // Y appears to be wrapped from the other side because why the hell not? { ++cellY; y -= ESM::Land::LAND_TEXTURE_SIZE;