Work around an issue with the remaster's e3m3.

This commit is contained in:
Shpoike 2023-10-15 05:56:25 +01:00
parent 90f1c061d2
commit ecf20de618

View file

@ -1606,11 +1606,19 @@ static void Mod_LoadFaces (lump_t *l, qboolean bsp2)
if (Mod_ParseWorldspawnKey(loadmodel, "lightmap_scale", scalebuf, sizeof(scalebuf))) if (Mod_ParseWorldspawnKey(loadmodel, "lightmap_scale", scalebuf, sizeof(scalebuf)))
{ {
i = atoi(scalebuf); char *e;
i = strtol(scalebuf, &e, 10);
if (i < 0 || *e)
Con_Warning("Incorrect value for lightmap_scale field - %s - should be texels-per-luxel (and power-of-two), use 16 to match vanilla quake.\n", scalebuf);
else if (i == 0)
; //silently use default when its explicitly set to 0 or empty. a bogus value but oh well.
else
{
for(defaultshift = 0; i > 1; defaultshift++) for(defaultshift = 0; i > 1; defaultshift++)
i >>= 1; i >>= 1;
} }
} }
}
loadmodel->surfaces = out; loadmodel->surfaces = out;
loadmodel->numsurfaces = count; loadmodel->numsurfaces = count;