diff --git a/src/hardware/hw_main.c b/src/hardware/hw_main.c index b01ceab39..a63435707 100644 --- a/src/hardware/hw_main.c +++ b/src/hardware/hw_main.c @@ -4479,7 +4479,7 @@ static void HWR_AddSprites(sector_t *sec) static void HWR_AddPrecipitationSprites(void) { INT32 xl, xh, yl, yh, bx, by; - precipmobj_t *th; + precipmobj_t *th, *next; fixed_t drawdist; @@ -4511,6 +4511,9 @@ static void HWR_AddPrecipitationSprites(void) { for (th = precipblocklinks[(by * bmapwidth) + bx]; th; th = next) { + // Store this beforehand because HWR_ProjectPrecipitationSprite may free th (see P_PrecipThinker) + next = th->bnext; + HWR_ProjectPrecipitationSprite(th); } }