Add PA_EDGE to handle Super teeter animation bug.

States were being improperly checked where a panim
would be more appropriate.
This commit is contained in:
Yukita Mayako 2015-06-18 11:36:08 -04:00
parent b17e39a701
commit ffec58c09c
4 changed files with 9 additions and 5 deletions

View file

@ -161,6 +161,7 @@ typedef enum
// Are animation frames playing?
PA_ETC=0,
PA_IDLE,
PA_EDGE,
PA_WALK,
PA_RUN,
PA_PAIN,

View file

@ -7665,6 +7665,7 @@ struct {
// Player animation (panim_t)
{"PA_ETC",PA_ETC},
{"PA_IDLE",PA_IDLE},
{"PA_EDGE",PA_EDGE},
{"PA_WALK",PA_WALK},
{"PA_RUN",PA_RUN},
{"PA_PAIN",PA_PAIN},

View file

@ -183,11 +183,13 @@ boolean P_SetPlayerMobjState(mobj_t *mobj, statenum_t state)
{
case S_PLAY_STND:
case S_PLAY_WAIT:
case S_PLAY_EDGE:
case S_PLAY_SUPER_STND:
case S_PLAY_SUPER_EDGE:
player->panim = PA_IDLE;
break;
case S_PLAY_EDGE:
case S_PLAY_SUPER_EDGE:
player->panim = PA_EDGE;
break;
case S_PLAY_WALK:
case S_PLAY_SUPER_WALK:
player->panim = PA_WALK;

View file

@ -3078,10 +3078,10 @@ teeterdone:
}
if (teeter)
{
if (player->panim == PA_IDLE && player->mo->state-states != S_PLAY_EDGE)
if (player->panim == PA_IDLE)
P_SetPlayerMobjState(player->mo, S_PLAY_EDGE);
}
else if (checkedforteeter && (player->mo->state-states == S_PLAY_EDGE || player->mo->state-states == S_PLAY_SUPER_EDGE))
else if (checkedforteeter && player->panim == PA_EDGE)
P_SetPlayerMobjState(player->mo, S_PLAY_STND);
}
@ -6884,7 +6884,7 @@ static void P_MovePlayer(player_t *player)
}
// Make sure you're not teetering when you shouldn't be.
if ((player->mo->state-states == S_PLAY_EDGE || player->mo->state-states == S_PLAY_SUPER_EDGE)
if (player->panim == PA_EDGE
&& (player->mo->momx || player->mo->momy || player->mo->momz))
P_SetPlayerMobjState(player->mo, S_PLAY_STND);