diff --git a/code/AssetLib/Terragen/TerragenLoader.cpp b/code/AssetLib/Terragen/TerragenLoader.cpp index dcf01461a..738ad8e27 100644 --- a/code/AssetLib/Terragen/TerragenLoader.cpp +++ b/code/AssetLib/Terragen/TerragenLoader.cpp @@ -230,8 +230,8 @@ void TerragenImporter::InternReadFile(const std::string &pFile, } // Get to the next chunk (4 byte aligned) - unsigned dtt = reader.GetCurrentPos(); - if (dtt & 0x3) { + unsigned dtt = reader.GetCurrentPos() & 0x3; + if (dtt) { reader.IncPtr(4 - dtt); } }