From 4d42be0e9081868c855225ee1497fb9d5ad5e593 Mon Sep 17 00:00:00 2001 From: nashmuhandes Date: Sat, 17 May 2025 06:51:00 +0800 Subject: [PATCH] Actually clamp the global sample distance early --- src/maploader/udmf.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/maploader/udmf.cpp b/src/maploader/udmf.cpp index 6cbbdc13b..cdfd0582c 100644 --- a/src/maploader/udmf.cpp +++ b/src/maploader/udmf.cpp @@ -841,7 +841,7 @@ public: DPrintf(DMSG_WARNING, "Current lm_sampledist value, %x, on the ZDRayInfo thing is out of range (min: %i, max: %i)\n", CheckInt(key), LIGHTMAP_GLOBAL_SAMPLE_DISTANCE_MIN, LIGHTMAP_GLOBAL_SAMPLE_DISTANCE_MAX); } - Level->LightmapSampleDistance = CheckInt(key); + Level->LightmapSampleDistance = std::clamp(CheckInt(key), LIGHTMAP_GLOBAL_SAMPLE_DISTANCE_MIN, LIGHTMAP_GLOBAL_SAMPLE_DISTANCE_MAX); break; case NAME_lm_bounce: