fix potential crash in ogl vissprite sorting

This commit is contained in:
Alug committed 2024-05-05 20:50:36 +02:00
1 parent 22166ceccb
commit 13249f7ad4
1 file changed
+3 -2
+3 -2
View File
@@ -4406,8 +4406,9 @@ static int CompareVisSprites(const void *p1, const void *p2)
// make transparent sprites last
// "boolean to int"
int transparency1 = (spr1->mobj->flags2 & MF2_SHADOW) || (spr1->mobj->frame & FF_TRANSMASK);
int transparency2 = (spr2->mobj->flags2 & MF2_SHADOW) || (spr2->mobj->frame & FF_TRANSMASK);
int transparency1 = !spr1->precip && (spr1->mobj->flags2 & MF2_SHADOW) || (spr1->mobj->frame & FF_TRANSMASK);
int transparency2 = !spr2->precip && (spr2->mobj->flags2 & MF2_SHADOW) || (spr2->mobj->frame & FF_TRANSMASK);
idiff = transparency1 - transparency2;
if (idiff != 0) return idiff;