mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2024-11-16 09:42:57 +00:00
No need to check for under/overflow outside of the spindash code, let's just start at the mindash and not add power if you're over instead.
This commit is contained in:
parent
2cee8c1a8d
commit
c11d8da3a3
1 changed files with 8 additions and 12 deletions
12
src/p_user.c
12
src/p_user.c
|
@ -3727,7 +3727,7 @@ static void P_DoSpinAbility(player_t *player, ticcmd_t *cmd)
|
||||||
player->mo->momx = player->cmomx;
|
player->mo->momx = player->cmomx;
|
||||||
player->mo->momy = player->cmomy;
|
player->mo->momy = player->cmomy;
|
||||||
player->pflags |= PF_STARTDASH|PF_SPINNING;
|
player->pflags |= PF_STARTDASH|PF_SPINNING;
|
||||||
player->dashspeed = FRACUNIT;
|
player->dashspeed = player->mindash;
|
||||||
P_SetPlayerMobjState(player->mo, S_PLAY_DASH);
|
P_SetPlayerMobjState(player->mo, S_PLAY_DASH);
|
||||||
player->pflags |= PF_USEDOWN;
|
player->pflags |= PF_USEDOWN;
|
||||||
if (!player->spectator)
|
if (!player->spectator)
|
||||||
|
@ -3735,12 +3735,15 @@ static void P_DoSpinAbility(player_t *player, ticcmd_t *cmd)
|
||||||
}
|
}
|
||||||
else if ((cmd->buttons & BT_USE) && (player->pflags & PF_STARTDASH))
|
else if ((cmd->buttons & BT_USE) && (player->pflags & PF_STARTDASH))
|
||||||
{
|
{
|
||||||
|
if (player->dashspeed < player->maxdash)
|
||||||
|
{
|
||||||
#define chargecalculation (6*(player->dashspeed - player->mindash))/(player->maxdash - player->mindash)
|
#define chargecalculation (6*(player->dashspeed - player->mindash))/(player->maxdash - player->mindash)
|
||||||
fixed_t soundcalculation = chargecalculation;
|
fixed_t soundcalculation = chargecalculation;
|
||||||
player->dashspeed += FRACUNIT;
|
player->dashspeed += FRACUNIT;
|
||||||
if (!player->spectator && soundcalculation != chargecalculation)
|
if (!player->spectator && soundcalculation != chargecalculation)
|
||||||
S_StartSound(player->mo, sfx_s3kab); // Make the rev sound! Previously sfx_spndsh.
|
S_StartSound(player->mo, sfx_s3kab); // Make the rev sound! Previously sfx_spndsh.
|
||||||
#undef chargecalculation
|
#undef chargecalculation
|
||||||
|
}
|
||||||
if (player->revitem && !(leveltime % 5)) // Now spawn the color thok circle.
|
if (player->revitem && !(leveltime % 5)) // Now spawn the color thok circle.
|
||||||
{
|
{
|
||||||
P_SpawnSpinMobj(player, player->revitem);
|
P_SpawnSpinMobj(player, player->revitem);
|
||||||
|
@ -6567,13 +6570,6 @@ static void P_MovePlayer(player_t *player)
|
||||||
P_SetPlayerMobjState(player->mo, S_PLAY_STND);
|
P_SetPlayerMobjState(player->mo, S_PLAY_STND);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Cap the speed limit on a spindash
|
|
||||||
// Up the 60*FRACUNIT number to boost faster, you speed demon you!
|
|
||||||
if (player->dashspeed > player->maxdash)
|
|
||||||
player->dashspeed = player->maxdash;
|
|
||||||
else if (player->dashspeed > 0 && player->dashspeed < player->mindash)
|
|
||||||
player->dashspeed = player->mindash;
|
|
||||||
|
|
||||||
if (!(player->charability == CA_GLIDEANDCLIMB) || player->gotflag) // If you can't glide, then why the heck would you be gliding?
|
if (!(player->charability == CA_GLIDEANDCLIMB) || player->gotflag) // If you can't glide, then why the heck would you be gliding?
|
||||||
{
|
{
|
||||||
if (player->pflags & PF_GLIDING || player->climbing)
|
if (player->pflags & PF_GLIDING || player->climbing)
|
||||||
|
|
Loading…
Reference in a new issue