mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Only spawn gates when SPB is close to the ground
This commit is contained in:
parent
38f6fe3112
commit
d7ce973aaf
1 changed files with 7 additions and 1 deletions
|
|
@ -78,6 +78,9 @@ static void SPBMantaRings(mobj_t *spb)
|
|||
fixed_t spacing = INT32_MAX;
|
||||
fixed_t finalDist = INT32_MAX;
|
||||
|
||||
const fixed_t floatHeight = 24 * spb->scale;
|
||||
fixed_t floorDist = INT32_MAX;
|
||||
|
||||
if (leveltime % SPB_MANTA_VRATE == 0)
|
||||
{
|
||||
spb_manta_vscale(spb) = max(spb_manta_vscale(spb) - 1, SPB_MANTA_VMAX);
|
||||
|
|
@ -89,9 +92,12 @@ static void SPBMantaRings(mobj_t *spb)
|
|||
vScale = FixedDiv(spb_manta_vscale(spb) * FRACUNIT, 100 * FRACUNIT);
|
||||
finalDist = FixedMul(spacing, vScale);
|
||||
|
||||
floorDist = abs(P_GetMobjFeet(spb) - P_GetMobjGround(spb));
|
||||
|
||||
spb_manta_totaldist(spb) += P_AproxDistance(spb->momx, spb->momy);
|
||||
|
||||
if (spb_manta_totaldist(spb) > finalDist)
|
||||
if (spb_manta_totaldist(spb) > finalDist
|
||||
&& floorDist <= floatHeight)
|
||||
{
|
||||
spb_manta_totaldist(spb) = 0;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue