2
0
mirror of https://github.com/rehlds/rehlds.git synced 2025-01-16 08:38:10 +03:00

CalcSurfaceExtents: Fixed a fatal error on some maps due loss of floating point

This commit is contained in:
s1lentq 2021-03-23 20:09:54 +07:00
parent a579f56679
commit 8aca7cfd8f

View File

@ -866,10 +866,12 @@ void CalcSurfaceExtents(msurface_t *s)
for (j = 0; j < 2; j++) for (j = 0; j < 2; j++)
{ {
val = v->position[0] * tex->vecs[j][0] + // FIXED: loss of floating point
v->position[1] * tex->vecs[j][1] + val = v->position[0] * (double)tex->vecs[j][0] +
v->position[2] * tex->vecs[j][2] + v->position[1] * (double)tex->vecs[j][1] +
tex->vecs[j][3]; v->position[2] * (double)tex->vecs[j][2] +
(double)tex->vecs[j][3];
if (val < mins[j]) if (val < mins[j])
mins[j] = val; mins[j] = val;
if (val > maxs[j]) if (val > maxs[j])