Skip to content

Commit cd15520

Browse files
committed
Fix crash calculating light level for blood splats
1 parent 8148692 commit cd15520

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/r_things.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1243,7 +1243,8 @@ static void R_AddBloodSplats(void)
12431243
for (bloodsplat_t *splat = bloodsplat_blocklinks[y * bmapwidth + x]; splat; splat = splat->bnext)
12441244
{
12451245
sector_t *sector = splat->sector;
1246-
const short lightlevel = (sector->floorlightsec ? sector->floorlightsec->lightlevel : sector->lightlevel);
1246+
const short lightlevel = BETWEEN(0, (sector->floorlightsec ? sector->floorlightsec->lightlevel :
1247+
sector->lightlevel), 255);
12471248

12481249
if (lightlevel != prevlightlevel)
12491250
{

0 commit comments

Comments
 (0)