mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-04-27 20:41:46 +00:00
Conditionally randomize precip height
This commit is contained in:
parent
f522cae573
commit
f13871ddbf
1 changed files with 16 additions and 2 deletions
18
src/p_mobj.c
18
src/p_mobj.c
|
|
@ -11640,6 +11640,9 @@ static void P_SpawnPrecipitationAt(fixed_t basex, fixed_t basey)
|
||||||
|
|
||||||
for (j = 0; j < numparticles; j++)
|
for (j = 0; j < numparticles; j++)
|
||||||
{
|
{
|
||||||
|
INT32 floorz;
|
||||||
|
INT32 ceilingz;
|
||||||
|
|
||||||
rainmo = P_SpawnPrecipMobj(x, y, z, type);
|
rainmo = P_SpawnPrecipMobj(x, y, z, type);
|
||||||
|
|
||||||
if (randomstates > 0)
|
if (randomstates > 0)
|
||||||
|
|
@ -11658,8 +11661,19 @@ static void P_SpawnPrecipitationAt(fixed_t basex, fixed_t basey)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Randomly assign a height, now that floorz is set.
|
floorz = rainmo->floorz >> FRACBITS;
|
||||||
rainmo->z = M_RandomRange(rainmo->floorz >> FRACBITS, rainmo->ceilingz >> FRACBITS) << FRACBITS;
|
ceilingz = rainmo->ceilingz >> FRACBITS;
|
||||||
|
|
||||||
|
if (floorz < ceilingz)
|
||||||
|
{
|
||||||
|
// Randomly assign a height, now that floorz is set.
|
||||||
|
rainmo->z = M_RandomRange(floorz, ceilingz) << FRACBITS;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// ...except if the floor is above the ceiling.
|
||||||
|
rainmo->z = ceilingz << FRACBITS;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue