Apply limits to the ZDRayInfo lm_sampledist value

This commit is contained in:
nashmuhandes 2024-10-02 01:37:30 +08:00
commit 5ac0b1b84c
3 changed files with 8 additions and 7 deletions

View file

@ -2967,7 +2967,7 @@ void MapLoader::InitLevelMesh(MapData* map)
if (map->Size(ML_LIGHTMAP))
{
// Arbitrary ZDRay limit. This will break lightmap lump loading if not enforced.
Level->LightmapSampleDistance = Level->LightmapSampleDistance < 8 ? 8 : Level->LightmapSampleDistance;
Level->LightmapSampleDistance = std::clamp((int)Level->LightmapSampleDistance, LIGHTMAP_GLOBAL_SAMPLE_DISTANCE_MIN, LIGHTMAP_GLOBAL_SAMPLE_DISTANCE_MAX);
if (!Level->lightmaps) // We are unfortunately missing ZDRayInfo
{