diff --git a/src/p_mobj.c b/src/p_mobj.c index 6b12bdca6153859c9cc3dc8eef1c0d27604c5f04..9f95f012bec05cb05ef0796cbce967cfa89b4b49 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -325,10 +325,11 @@ boolean P_SetPlayerMobjState(mobj_t *mobj, statenum_t state) } else if (player->panim == PA_ABILITY2 && player->charability2 == CA2_SPINDASH) { - speed = player->maxdash/3; // We're using dashspeed as the variable to check against, but reusing speed to reduce the number of calculations done. - if (player->dashspeed > 2*speed) + fixed_t step = (player->maxdash - player->mindash)/4; + speed = (player->dashspeed - player->mindash); + if (speed > 3*step) mobj->tics = 1; - else if (player->dashspeed > speed) + else if (speed > step) mobj->tics = 2; else mobj->tics = 3; diff --git a/src/p_user.c b/src/p_user.c index b6b5f15e645a7bd5b4ddc564b5469f2ee3dd5438..73f68e60e0f855c88c214b80306eb9dc0d9f9cdb 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -3731,15 +3731,22 @@ static void P_DoSpinAbility(player_t *player, ticcmd_t *cmd) player->dashtime = 0; P_SetPlayerMobjState(player->mo, S_PLAY_DASH); player->pflags |= PF_USEDOWN; + if (!player->spectator) + S_StartSound(player->mo, sfx_s3kab); // Make the rev sound! Previously sfx_spndsh. } else if ((cmd->buttons & BT_USE) && (player->pflags & PF_STARTDASH)) { +#define chargecalculation (6*(player->dashspeed - player->mindash))/(player->maxdash - player->mindash) + fixed_t soundcalculation = chargecalculation; player->dashspeed += FRACUNIT; + if (!player->spectator && soundcalculation != chargecalculation) + S_StartSound(player->mo, sfx_s3kab); // Make the rev sound! Previously sfx_spndsh. +#undef chargecalculation - if (!(player->dashtime++ % 5)) + /*if (!(player->dashtime++ % 5)) { if (!player->spectator && player->dashspeed < player->maxdash) - S_StartSound(player->mo, sfx_spndsh); // Make the rev sound! + S_StartSound(player->mo, sfx_s3kab); // Make the rev sound! Previously sfx_spndsh. // Now spawn the color thok circle. if (player->revitem) @@ -3748,7 +3755,7 @@ static void P_DoSpinAbility(player_t *player, ticcmd_t *cmd) if (demorecording) G_GhostAddRev(); } - } + }*/ } // If not moving up or down, and travelling faster than a speed of four while not holding // down the spin button and not spinning.