diff --git a/code/renderergl1/tr_terrain.c b/code/renderergl1/tr_terrain.c index bcbab3da..10f73a15 100644 --- a/code/renderergl1/tr_terrain.c +++ b/code/renderergl1/tr_terrain.c @@ -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); diff --git a/code/renderergl2/tr_terrain.c b/code/renderergl2/tr_terrain.c index 61fa1f2d..94c5fff2 100644 --- a/code/renderergl2/tr_terrain.c +++ b/code/renderergl2/tr_terrain.c @@ -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);