From edc171be0462e1f3b908a0603fec7dc7b09f94ad Mon Sep 17 00:00:00 2001 From: SNMetamorph <25657591+SNMetamorph@users.noreply.github.com> Date: Mon, 28 Feb 2022 19:46:19 +0400 Subject: [PATCH] engine: common: fixed lightmap shift again --- engine/common/mod_bmodel.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/engine/common/mod_bmodel.c b/engine/common/mod_bmodel.c index 957395a5..6edaa606 100644 --- a/engine/common/mod_bmodel.c +++ b/engine/common/mod_bmodel.c @@ -1020,8 +1020,10 @@ Fills in surf->texturemins[] and surf->extents[] */ static void Mod_CalcSurfaceExtents( msurface_t *surf ) { - double mins[2], maxs[2], val; - double lmmins[2], lmmaxs[2]; + // this place is VERY critical to precision + // keep it as float, don't use double, because it causes issues with lightmap + float mins[2], maxs[2], val; + float lmmins[2], lmmaxs[2]; int bmins[2], bmaxs[2]; int i, j, e, sample_size; mextrasurf_t *info = surf->info;