Offroad effect fixes

- Make dust retain some of your speed so it's more visible
- Only play effect when moving and on the ground
This commit is contained in:
TehRealSalt 2018-11-19 22:45:12 -05:00
parent 4590d5c5cf
commit 555deddb6a

View file

@ -1626,7 +1626,7 @@ static void K_GetKartBoostPower(player_t *player)
boostpower = 4*boostpower/5; boostpower = 4*boostpower/5;
// Banana drag/offroad dust // Banana drag/offroad dust
if (boostpower < FRACUNIT) if (boostpower < FRACUNIT && player->mo && P_IsObjectOnGround(player->mo) && player->speed > 0)
{ {
K_SpawnWipeoutTrail(player->mo, true); K_SpawnWipeoutTrail(player->mo, true);
if (leveltime % 6 == 0) if (leveltime % 6 == 0)
@ -2660,6 +2660,13 @@ void K_SpawnWipeoutTrail(mobj_t *mo, boolean translucent)
P_SetScale(dust, mo->scale); P_SetScale(dust, mo->scale);
dust->eflags = (dust->eflags & ~MFE_VERTICALFLIP)|(mo->eflags & MFE_VERTICALFLIP); // not K_MatchGenericExtraFlags because hyudoro shouldn't be able to wipeout dust->eflags = (dust->eflags & ~MFE_VERTICALFLIP)|(mo->eflags & MFE_VERTICALFLIP); // not K_MatchGenericExtraFlags because hyudoro shouldn't be able to wipeout
if (translucent) // offroad effect
{
dust->momx = mo->momx/2;
dust->momy = mo->momy/2;
dust->momz = mo->momz/2;
}
if (translucent) if (translucent)
dust->flags2 |= MF2_SHADOW; dust->flags2 |= MF2_SHADOW;
} }