P_SwitchWeather: Fix potential infinite loop if non-NullPrecipThinker thinker existed in THINK_PRECIP

This commit is contained in:
toaster 2023-04-08 21:55:28 +01:00
parent 9eab5317f3
commit c76fc45de9

View file

@ -1838,12 +1838,12 @@ void P_SwitchWeather(preciptype_t newWeather)
for (think = thlist[THINK_PRECIP].next; think != &thlist[THINK_PRECIP]; think = next)
{
next = think->next;
if (think->function.acp1 != (actionf_p1)P_NullPrecipThinker)
continue; // not a precipmobj thinker
precipmobj = (precipmobj_t *)think;
next = think->next;
P_FreePrecipMobj(precipmobj);
}
}