diff --git a/src/p_mobj.c b/src/p_mobj.c index ad437585f..148273491 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -10370,7 +10370,7 @@ void P_SpawnPrecipitation(void) subsector_t *precipsector = NULL; precipmobj_t *rainmo = NULL; - if (dedicated || !(cv_drawdist_precip.value) || curWeather == PRECIP_NONE || curWeather == PRECIP_STORM_NORAIN) // SRB2Kart + if (dedicated || /*!cv_precipdensity*/!cv_drawdist_precip.value || curWeather == PRECIP_NONE) // SRB2Kart return; // Use the blockmap to narrow down our placing patterns @@ -10413,13 +10413,22 @@ void P_SpawnPrecipitation(void) } else // everything else. rainmo = P_SpawnRainMobj(x, y, height, MT_RAIN); - if (curWeather == PRECIP_BLANK) - rainmo->precipflags |= PCF_INVISIBLE; // Randomly assign a height, now that floorz is set. rainmo->z = M_RandomRange(rainmo->floorz>>FRACBITS, rainmo->ceilingz>>FRACBITS)<flags = mobjinfo[MT_RAIN].flags; st = &states[mobjinfo[MT_RAIN].spawnstate]; @@ -2053,7 +2092,7 @@ void P_SwitchWeather(INT32 weathernum) precipmobj->precipflags |= PCF_RAIN; //think->function.acp1 = (actionf_p1)P_RainThinker; } - else if (weathernum == PRECIP_SNOW) // Rain To Snow + else if (swap == PRECIP_SNOW) // Rain To Snow { INT32 z; @@ -2078,7 +2117,7 @@ void P_SwitchWeather(INT32 weathernum) //think->function.acp1 = (actionf_p1)P_SnowThinker; } - else // Remove precip, but keep it around for reuse. + else if (swap == PRECIP_BLANK || swap == PRECIP_STORM_NORAIN) // Remove precip, but keep it around for reuse. { //think->function.acp1 = (actionf_p1)P_NullPrecipThinker; @@ -2092,31 +2131,48 @@ void P_SwitchWeather(INT32 weathernum) case PRECIP_SNOW: // snow curWeather = PRECIP_SNOW; - if (purge) + if (!swap) P_SpawnPrecipitation(); break; case PRECIP_RAIN: // rain { + boolean dontspawn = false; + + if (curWeather == PRECIP_RAIN || curWeather == PRECIP_STORM || curWeather == PRECIP_STORM_NOSTRIKES) + dontspawn = true; + curWeather = PRECIP_RAIN; - if (purge) + if (!dontspawn && !swap) P_SpawnPrecipitation(); break; } case PRECIP_STORM: // storm { + boolean dontspawn = false; + + if (curWeather == PRECIP_RAIN || curWeather == PRECIP_STORM || curWeather == PRECIP_STORM_NOSTRIKES) + dontspawn = true; + curWeather = PRECIP_STORM; - if (purge) + if (!dontspawn && !swap) P_SpawnPrecipitation(); break; } case PRECIP_STORM_NOSTRIKES: // storm w/o lightning { - if (purge) + boolean dontspawn = false; + + if (curWeather == PRECIP_RAIN || curWeather == PRECIP_STORM || curWeather == PRECIP_STORM_NOSTRIKES) + dontspawn = true; + + curWeather = PRECIP_STORM_NOSTRIKES; + + if (!dontspawn && !swap) P_SpawnPrecipitation(); break; @@ -2124,11 +2180,14 @@ void P_SwitchWeather(INT32 weathernum) case PRECIP_STORM_NORAIN: // storm w/o rain curWeather = PRECIP_STORM_NORAIN; + if (!swap) + P_SpawnPrecipitation(); + break; - case PRECIP_BLANK: //preloaded + case PRECIP_BLANK: curWeather = PRECIP_BLANK; - if (purge) + if (!swap) P_SpawnPrecipitation(); break;