1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-26 18:35:20 +00:00

Fix local map viewing distance lower bound

This commit is contained in:
Alexei Kotov 2022-07-26 00:00:42 +03:00
parent b7763fad2d
commit f99bcd7ccf

View File

@ -104,7 +104,7 @@ namespace
return Constants::CellGridRadius;
const int maxLocalViewingDistance = std::max(Settings::Manager::getInt("max local viewing distance", "Map"), Constants::CellGridRadius);
const int viewingDistanceInCells = Settings::Manager::getFloat("viewing distance", "Camera") / Constants::CellSizeInUnits;
return std::min(maxLocalViewingDistance, viewingDistanceInCells);
return std::clamp(viewingDistanceInCells, Constants::CellGridRadius, maxLocalViewingDistance);
}
}