From 555deddb6afd65d24b229c064cb0048006eb4f0f Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Mon, 19 Nov 2018 22:45:12 -0500 Subject: [PATCH] Offroad effect fixes - Make dust retain some of your speed so it's more visible - Only play effect when moving and on the ground --- src/k_kart.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/k_kart.c b/src/k_kart.c index a903112e..d5a224dc 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -1626,7 +1626,7 @@ static void K_GetKartBoostPower(player_t *player) boostpower = 4*boostpower/5; // Banana drag/offroad dust - if (boostpower < FRACUNIT) + if (boostpower < FRACUNIT && player->mo && P_IsObjectOnGround(player->mo) && player->speed > 0) { K_SpawnWipeoutTrail(player->mo, true); if (leveltime % 6 == 0) @@ -2660,6 +2660,13 @@ void K_SpawnWipeoutTrail(mobj_t *mo, boolean translucent) 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 + if (translucent) // offroad effect + { + dust->momx = mo->momx/2; + dust->momy = mo->momy/2; + dust->momz = mo->momz/2; + } + if (translucent) dust->flags2 |= MF2_SHADOW; }