From da3fa8f6e93ee864169b3482e60d39d5f8300304 Mon Sep 17 00:00:00 2001 From: Paul Date: Mon, 29 Jan 2001 19:23:04 +0000 Subject: [PATCH] --- source/player/player.cpp | 8 ++++---- source/player/psidle.cpp | 9 +++++---- source/player/psrun.cpp | 7 ++++--- 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/source/player/player.cpp b/source/player/player.cpp index 806885ec5..4f8d6d5ee 100644 --- a/source/player/player.cpp +++ b/source/player/player.cpp @@ -146,11 +146,11 @@ void CPlayer::think(int _frames) Pos.vx+=m_moveVel.vx>>VELOCITY_SHIFT; if(Pos.vx<350) { -// if(m_currentState==STATE_RUN) -// { -// setState(STATE_IDLE); + if(m_currentState==STATE_RUN) + { + setState(STATE_IDLE); // setAnimNo(ANIM_PLAYER_ANIM_RUNSTOP); -// } + } Pos.vx=350; m_moveVel.vx=0; } diff --git a/source/player/psidle.cpp b/source/player/psidle.cpp index c67e34499..2222e8d48 100644 --- a/source/player/psidle.cpp +++ b/source/player/psidle.cpp @@ -98,6 +98,11 @@ void CPlayerStateIdle::think(CPlayer *_player) int control; control=getPadInput(_player); + if(advanceAnimFrameAndCheckForEndOfAnim(_player)) + { + setNextIdleAnim(_player); + } + if(control&CPadConfig::getButton(CPadConfig::PAD_CFG_JUMP)) { setState(_player,STATE_JUMP); @@ -114,10 +119,6 @@ void CPlayerStateIdle::think(CPlayer *_player) { setState(_player,STATE_DUCK); } - else if(advanceAnimFrameAndCheckForEndOfAnim(_player)) - { - setNextIdleAnim(_player); - } } diff --git a/source/player/psrun.cpp b/source/player/psrun.cpp index ba0556265..fea50caad 100644 --- a/source/player/psrun.cpp +++ b/source/player/psrun.cpp @@ -106,15 +106,16 @@ void CPlayerStateRun::think(CPlayer *_player) { setState(_player,STATE_JUMP); } - else if(control&CPadConfig::getButton(CPadConfig::PAD_CFG_DOWN)) + if(control&CPadConfig::getButton(CPadConfig::PAD_CFG_DOWN)) { setState(_player,STATE_DUCK); } - else if(control&CPadConfig::getButton(CPadConfig::PAD_CFG_ACTION)) + if(control&CPadConfig::getButton(CPadConfig::PAD_CFG_ACTION)) { setState(_player,STATE_RUNATTACK); } - else if(control&CPadConfig::getButton(CPadConfig::PAD_CFG_LEFT)) + + if(control&CPadConfig::getButton(CPadConfig::PAD_CFG_LEFT)) { moveLeft(_player); }