Fix get vertex Height for esm4

macos_ci
florent.teppe 2 years ago
parent ff9e04062d
commit 9f9a6c06e0

@ -125,9 +125,10 @@ namespace ESMTerrain
float getVertexHeight(const ESM::LandData* data, int x, int y) float getVertexHeight(const ESM::LandData* data, int x, int y)
{ {
assert(x < ESM::Land::LAND_SIZE); const int landSize = data->getLandSize();
assert(y < ESM::Land::LAND_SIZE); assert(x < landSize);
return data->getHeights()[y * ESM::Land::LAND_SIZE + x]; assert(y < landSize);
return data->getHeights()[y * landSize + x];
} }
private: private:

Loading…
Cancel
Save