mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
R_AddPrecipitationSprites: fix use of th after freed
R_ProjectPrecipitationSprite may free th
This commit is contained in:
parent
56e710266c
commit
42146c5ea2
1 changed files with 5 additions and 2 deletions
|
|
@ -2843,7 +2843,7 @@ void R_AddPrecipitationSprites(void)
|
|||
const fixed_t drawdist = cv_drawdist_precip.value * mapobjectscale;
|
||||
|
||||
INT32 xl, xh, yl, yh, bx, by;
|
||||
precipmobj_t *th;
|
||||
precipmobj_t *th, *next;
|
||||
|
||||
// no, no infinite draw distance for precipitation. this option at zero is supposed to turn it off
|
||||
if (drawdist == 0)
|
||||
|
|
@ -2863,8 +2863,11 @@ void R_AddPrecipitationSprites(void)
|
|||
{
|
||||
for (by = yl; by <= yh; by++)
|
||||
{
|
||||
for (th = precipblocklinks[(by * bmapwidth) + bx]; th; th = th->bnext)
|
||||
for (th = precipblocklinks[(by * bmapwidth) + bx]; th; th = next)
|
||||
{
|
||||
// Store this beforehand because R_ProjectPrecipitionSprite may free th (see P_PrecipThinker)
|
||||
next = th->bnext;
|
||||
|
||||
if (R_PrecipThingVisible(th))
|
||||
{
|
||||
R_ProjectPrecipitationSprite(th);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue