mirror of
https://github.com/FWGS/xash3d-fwgs.git
synced 2026-08-05 03:24:56 +08:00
ref: soft: Try to stop decal->pnext loops from recursing infinitely
Doesn't fix the root cause of the problem, which is the mysterious setting of decal->pnext to decal which doesn't happen in GL, but does act as a blockade and a temporary fix
This commit is contained in:
committed by
a1batross
parent
009855c193
commit
f2166a2c9d
@@ -470,6 +470,8 @@ static decal_t *R_DecalIntersect( decalinfo_t *decalinfo, msurface_t *surf, int
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if( pDecal == pDecal->pnext ) break;
|
||||||
pDecal = pDecal->pnext;
|
pDecal = pDecal->pnext;
|
||||||
}
|
}
|
||||||
return plast;
|
return plast;
|
||||||
@@ -523,7 +525,10 @@ static void R_AddDecalToSurface( decal_t *pdecal, msurface_t *surf, decalinfo_t
|
|||||||
if( pold )
|
if( pold )
|
||||||
{
|
{
|
||||||
while( pold->pnext )
|
while( pold->pnext )
|
||||||
|
{
|
||||||
|
if( pold == pold->pnext ) break;
|
||||||
pold = pold->pnext;
|
pold = pold->pnext;
|
||||||
|
}
|
||||||
pold->pnext = pdecal;
|
pold->pnext = pdecal;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -599,8 +604,10 @@ static void R_DecalSurface( msurface_t *surf, decalinfo_t *decalinfo )
|
|||||||
{
|
{
|
||||||
// NOTE: we may have the decal on this surface that come from another level.
|
// NOTE: we may have the decal on this surface that come from another level.
|
||||||
// check duplicate with same position and texture
|
// check duplicate with same position and texture
|
||||||
while( decal != NULL && decal != decal->pnext )
|
while( decal != NULL )
|
||||||
{
|
{
|
||||||
|
if( decal == decal->pnext ) break;
|
||||||
|
|
||||||
if( VectorCompare( decal->position, decalinfo->m_Position ) && decal->texture == decalinfo->m_iTexture )
|
if( VectorCompare( decal->position, decalinfo->m_Position ) && decal->texture == decalinfo->m_iTexture )
|
||||||
return; // decal already exists, don't place it again
|
return; // decal already exists, don't place it again
|
||||||
decal = decal->pnext;
|
decal = decal->pnext;
|
||||||
|
|||||||
Reference in New Issue
Block a user