fix portals dying

due to nummasks being too small and causing an overflow
ty hannu!
This commit is contained in:
Alug committed 2025-06-09 20:57:19 +02:00
1 parent 793ccff6e6
commit a8005d5cec
3 files changed
+4 -4

No files matched your search

+1 -1
View File
@@ -1355,7 +1355,7 @@ static fixed_t viewfov[MAXSPLITSCREENPLAYERS];
void R_RenderPlayerView(player_t *player)
{
UINT8 nummasks = 1;
INT32 nummasks = 1;
maskcount_t* masks = static_cast<maskcount_t*>(malloc(sizeof(maskcount_t)));
const boolean skybox = (skyboxmo[0] && cv_skybox.value);
UINT8 i;
+2 -2
View File
@@ -3016,9 +3016,9 @@ static void R_DrawMaskedList(drawnode_t* head)
}
}
void R_DrawMasked(maskcount_t* masks, UINT8 nummasks)
void R_DrawMasked(maskcount_t* masks, INT32 nummasks)
{
UINT8 i;
INT32 i;
drawnode_t *heads; /**< Drawnode lists; as many as number of views/portals. */
heads = static_cast<drawnode_t*>(calloc(nummasks, sizeof(drawnode_t)));
+1 -1
View File
@@ -80,7 +80,7 @@ typedef struct
sector_t* viewsector;
} maskcount_t;
void R_DrawMasked(maskcount_t* masks, UINT8 nummasks);
void R_DrawMasked(maskcount_t* masks, INT32 nummasks);
boolean R_ThingVisible(mobj_t *thing);
boolean R_ThingWithinDist(mobj_t *thing, INT32 limit_dist);