Fix assertion when the height is identical between vert0 and vert1

This commit is contained in:
smallmodel 2025-02-08 20:28:46 +01:00
parent ac4b4266b4
commit ff3c27ab20
No known key found for this signature in database
GPG key ID: 9F2D623CEDF08512
2 changed files with 2 additions and 2 deletions

View file

@ -144,7 +144,7 @@ static void R_InterpolateVert(terraTri_t *pTri, terrainVert_t *pVert)
pMinHeight = (byte *)Q_min((uintptr_t)pVert0->pHgt, (uintptr_t)pVert1->pHgt);
pMaxHeight = (byte *)Q_max((uintptr_t)pVert0->pHgt, (uintptr_t)pVert1->pHgt);
pVert->pHgt = (byte *)(pMinHeight + ((pMaxHeight - pMinHeight) >> 1));
assert(pVert->pHgt >= pMinHeight && pVert->pHgt < pMaxHeight);
assert(pVert->pHgt >= pMinHeight && pVert->pHgt < pMaxHeight || pMinHeight == pMaxHeight);
// Calculate the average Z
pVert->fHgtAvg = (float)(*pVert0->pHgt + *pVert1->pHgt);

View file

@ -141,7 +141,7 @@ static void R_InterpolateVert(terraTri_t *pTri, terrainVert_t *pVert)
pMinHeight = (byte *)Q_min((uintptr_t)pVert0->pHgt, (uintptr_t)pVert1->pHgt);
pMaxHeight = (byte *)Q_max((uintptr_t)pVert0->pHgt, (uintptr_t)pVert1->pHgt);
pVert->pHgt = (byte *)(pMinHeight + ((pMaxHeight - pMinHeight) >> 1));
assert(pVert->pHgt >= pMinHeight && pVert->pHgt < pMaxHeight);
assert(pVert->pHgt >= pMinHeight && pVert->pHgt < pMaxHeight || pMinHeight == pMaxHeight);
// Calculate the average Z
pVert->fHgtAvg = (float)(*pVert0->pHgt + *pVert1->pHgt);