From ffec58c09cadfb484f60ed590b786c9a0077a570 Mon Sep 17 00:00:00 2001 From: Yukita Mayako Date: Thu, 18 Jun 2015 11:36:08 -0400 Subject: [PATCH] Add PA_EDGE to handle Super teeter animation bug. States were being improperly checked where a panim would be more appropriate. --- src/d_player.h | 1 + src/dehacked.c | 1 + src/p_mobj.c | 6 ++++-- src/p_user.c | 6 +++--- 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/d_player.h b/src/d_player.h index 9c8e7da59..e2a1081b0 100644 --- a/src/d_player.h +++ b/src/d_player.h @@ -161,6 +161,7 @@ typedef enum // Are animation frames playing? PA_ETC=0, PA_IDLE, + PA_EDGE, PA_WALK, PA_RUN, PA_PAIN, diff --git a/src/dehacked.c b/src/dehacked.c index 5b402a005..34b1a209c 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -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}, diff --git a/src/p_mobj.c b/src/p_mobj.c index 634af46ae..9f8806053 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -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; diff --git a/src/p_user.c b/src/p_user.c index cad107c7f..c359fff5b 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -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);