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;