mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-03-21 18:32:08 +00:00
Putting the swim animation checks in one place.
This commit is contained in:
parent
cc35a5e1c1
commit
226785dcd6
2 changed files with 7 additions and 12 deletions
|
@ -167,6 +167,12 @@ boolean P_SetPlayerMobjState(mobj_t *mobj, statenum_t state)
|
|||
if ((state == S_PLAY_JUMP) && (player->charflags & SF_NOJUMPSPIN) && (P_MobjFlip(mobj)*mobj->momz < 0 || player->pflags & PF_THOKKED))
|
||||
return P_SetPlayerMobjState(mobj, S_PLAY_FALL);
|
||||
|
||||
// Catch swimming versus flying
|
||||
if (state == S_PLAY_FLY && player->mo->eflags & MFE_UNDERWATER)
|
||||
return P_SetPlayerMobjState(player->mo, S_PLAY_SWIM);
|
||||
else if (state == S_PLAY_SWIM && !(player->mo->eflags & MFE_UNDERWATER))
|
||||
return P_SetPlayerMobjState(player->mo, S_PLAY_FLY);
|
||||
|
||||
// Catch state changes for Super Sonic
|
||||
if (player->powers[pw_super] && (player->charflags & SF_SUPERANIMS))
|
||||
{
|
||||
|
|
13
src/p_user.c
13
src/p_user.c
|
@ -4111,10 +4111,7 @@ static void P_DoJumpStuff(player_t *player, ticcmd_t *cmd)
|
|||
; // Can't do anything if you're a fish out of water!
|
||||
else if (!(player->pflags & PF_THOKKED) && !(player->powers[pw_tailsfly]))
|
||||
{
|
||||
if (player->mo->eflags & MFE_UNDERWATER)
|
||||
P_SetPlayerMobjState(player->mo, S_PLAY_SWIM); // Change to the swimming animation
|
||||
else
|
||||
P_SetPlayerMobjState(player->mo, S_PLAY_FLY); // Change to the flying animation
|
||||
P_SetPlayerMobjState(player->mo, S_PLAY_FLY); // Change to the flying animation
|
||||
|
||||
player->powers[pw_tailsfly] = tailsflytics + 1; // Set the fly timer
|
||||
|
||||
|
@ -6737,14 +6734,6 @@ static void P_MovePlayer(player_t *player)
|
|||
if (player->panim != PA_ABILITY)
|
||||
player->powers[pw_tailsfly] = 0;
|
||||
|
||||
if (player->charability == CA_FLY || player->charability == CA_SWIM) // Frustratingly has to remain seperate from the below block.
|
||||
{
|
||||
if (player->mo->state-states == S_PLAY_FLY && player->mo->eflags & MFE_UNDERWATER)
|
||||
P_SetPlayerMobjState(player->mo, S_PLAY_SWIM); // Change to the swimming animation
|
||||
else if (player->mo->state-states == S_PLAY_SWIM && !(player->mo->eflags & MFE_UNDERWATER))
|
||||
P_SetPlayerMobjState(player->mo, S_PLAY_FLY); // Change to the flying animation
|
||||
}
|
||||
|
||||
if (player->charability == CA_FLY || (player->charability == CA_SWIM && player->mo->eflags & MFE_UNDERWATER))
|
||||
{
|
||||
// Fly counter for Tails.
|
||||
|
|
Loading…
Reference in a new issue