Realised I accidentially broke rain in the rainfixes branch (oh, the irony!), realised it needed a few additional P_RecalcPrecipInSector calls to properly work with the new arena, and increased its speed.

If you must, I can cherrypick this into another branch - but it's required for this one, at least.
This commit is contained in:
toaster 2019-07-04 14:43:18 +01:00
parent b78fac66c4
commit 5baaba1d9e
4 changed files with 47 additions and 46 deletions

View file

@ -3188,8 +3188,8 @@ state_t states[NUMSTATES] =
{SPR_SSWB, 1, 1, {NULL}, 0, 0, S_BHORIZ1}, // S_BHORIZ8 {SPR_SSWB, 1, 1, {NULL}, 0, 0, S_BHORIZ1}, // S_BHORIZ8
// Rain // Rain
{SPR_RAIN, FF_TRANS50, -1, {NULL}, 0, 0, S_NULL}, // S_RAIN1 {SPR_RAIN, FF_FULLBRIGHT|FF_TRANS50, -1, {NULL}, 0, 0, S_NULL}, // S_RAIN1
{SPR_RAIN, FF_TRANS50, 1, {NULL}, 0, 0, S_RAIN1}, // S_RAINRETURN {SPR_RAIN, FF_FULLBRIGHT|FF_TRANS50, 1, {NULL}, 0, 0, S_RAIN1}, // S_RAINRETURN
// Snowflake // Snowflake
{SPR_SNO1, 0, -1, {NULL}, 0, 0, S_NULL}, // S_SNOW1 {SPR_SNO1, 0, -1, {NULL}, 0, 0, S_NULL}, // S_SNOW1
@ -16121,7 +16121,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
S_NULL, // deathstate S_NULL, // deathstate
S_NULL, // xdeathstate S_NULL, // xdeathstate
sfx_None, // deathsound sfx_None, // deathsound
-24*FRACUNIT, // speed -72*FRACUNIT, // speed
1*FRACUNIT, // radius 1*FRACUNIT, // radius
8*FRACUNIT, // height 8*FRACUNIT, // height
0, // display offset 0, // display offset

View file

@ -3130,7 +3130,7 @@ void EV_CrumbleChain(sector_t *sec, ffloor_t *rover)
// no longer exists (can't collide with again) // no longer exists (can't collide with again)
rover->flags &= ~FF_EXISTS; rover->flags &= ~FF_EXISTS;
rover->master->frontsector->moved = true; rover->master->frontsector->moved = true;
sec->moved = true; P_RecalcPrecipInSector(sec);
} }
// Used for bobbing platforms on the water // Used for bobbing platforms on the water

View file

@ -9640,12 +9640,12 @@ consvar_t cv_flagtime = {"flagtime", "30", CV_NETVAR|CV_CHEAT, flagtime_cons_t,
void P_SpawnPrecipitation(void) void P_SpawnPrecipitation(void)
{ {
INT32 i /*, j*/, mrand; INT32 i, mrand;
fixed_t basex, basey, x, y, height; fixed_t basex, basey, x, y, height;
subsector_t *precipsector = NULL; subsector_t *precipsector = NULL;
precipmobj_t *rainmo = NULL; precipmobj_t *rainmo = NULL;
if (dedicated || /*!cv_precipdensity*/!cv_drawdist_precip.value || curWeather == PRECIP_NONE) if (dedicated || !(cv_drawdist_precip.value) || curWeather == PRECIP_NONE)
return; return;
// Use the blockmap to narrow down our placing patterns // Use the blockmap to narrow down our placing patterns
@ -9654,8 +9654,6 @@ void P_SpawnPrecipitation(void)
basex = bmaporgx + (i % bmapwidth) * MAPBLOCKSIZE; basex = bmaporgx + (i % bmapwidth) * MAPBLOCKSIZE;
basey = bmaporgy + (i / bmapwidth) * MAPBLOCKSIZE; basey = bmaporgy + (i / bmapwidth) * MAPBLOCKSIZE;
//for (j = 0; j < cv_precipdensity.value; ++j) -- density is 1 for us always
{
x = basex + ((M_RandomKey(MAPBLOCKUNITS<<3)<<FRACBITS)>>3); x = basex + ((M_RandomKey(MAPBLOCKUNITS<<3)<<FRACBITS)>>3);
y = basey + ((M_RandomKey(MAPBLOCKUNITS<<3)<<FRACBITS)>>3); y = basey + ((M_RandomKey(MAPBLOCKUNITS<<3)<<FRACBITS)>>3);
@ -9664,7 +9662,7 @@ void P_SpawnPrecipitation(void)
// No sector? Stop wasting time, // No sector? Stop wasting time,
// move on to the next entry in the blockmap // move on to the next entry in the blockmap
if (!precipsector) if (!precipsector)
break; continue;
// Exists, but is too small for reasonable precipitation. // Exists, but is too small for reasonable precipitation.
if (!(precipsector->sector->floorheight <= precipsector->sector->ceilingheight - (32<<FRACBITS))) if (!(precipsector->sector->floorheight <= precipsector->sector->ceilingheight - (32<<FRACBITS)))
@ -9698,7 +9696,6 @@ void P_SpawnPrecipitation(void)
// Randomly assign a height, now that floorz is set. // Randomly assign a height, now that floorz is set.
rainmo->z = M_RandomRange(rainmo->floorz>>FRACBITS, rainmo->ceilingz>>FRACBITS)<<FRACBITS; rainmo->z = M_RandomRange(rainmo->floorz>>FRACBITS, rainmo->ceilingz>>FRACBITS)<<FRACBITS;
} }
}
if (curWeather == PRECIP_BLANK) if (curWeather == PRECIP_BLANK)
{ {

View file

@ -3382,7 +3382,10 @@ static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec)
// if flags changed, reset sector's light list // if flags changed, reset sector's light list
if (rover->flags != oldflags) if (rover->flags != oldflags)
{
sec->moved = true; sec->moved = true;
P_RecalcPrecipInSector(sec);
}
} }
} }
@ -7879,6 +7882,7 @@ void T_Disappear(disappear_t *d)
} }
} }
sectors[s].moved = true; sectors[s].moved = true;
P_RecalcPrecipInSector(&sectors[s]);
} }
if (d->exists) if (d->exists)