diff --git a/source/player/pscrouch.cpp b/source/player/pscrouch.cpp index 81af886fd..467c06241 100644 --- a/source/player/pscrouch.cpp +++ b/source/player/pscrouch.cpp @@ -80,6 +80,9 @@ void CPlayerStateCrouchDown::enter(CPlayerModeBase *_playerMode) void CPlayerStateCrouchDown::think(CPlayerModeBase *_playerMode) { int maxFrame; + int controlDown,controlHeld; + controlDown=_playerMode->getPadInputDown(); + controlHeld=_playerMode->getPadInputHeld(); _playerMode->slowdown(); @@ -90,11 +93,26 @@ void CPlayerStateCrouchDown::think(CPlayerModeBase *_playerMode) } else { - if(!(_playerMode->getPadInputHeld()&PI_DOWN)) + if(!(controlHeld&PI_DOWN)) { _playerMode->setState(STATE_CROUCHUP); } } + + if(controlDown&PI_JUMP) + { + _playerMode->setState(STATE_JUMP); + } + else if(controlHeld&PI_LEFT) + { + if(_playerMode->canMoveLeft()) + _playerMode->setState(STATE_RUN); + } + else if(controlHeld&PI_RIGHT) + { + if(_playerMode->canMoveRight()) + _playerMode->setState(STATE_RUN); + } } @@ -118,10 +136,29 @@ void CPlayerStateCrouchUp::enter(CPlayerModeBase *_playerMode) ---------------------------------------------------------------------- */ void CPlayerStateCrouchUp::think(CPlayerModeBase *_playerMode) { + int controlDown,controlHeld; + controlDown=_playerMode->getPadInputDown(); + controlHeld=_playerMode->getPadInputHeld(); + if(_playerMode->advanceAnimFrameAndCheckForEndOfAnim()) { _playerMode->setState(STATE_IDLE); } + + if(controlDown&PI_JUMP) + { + _playerMode->setState(STATE_JUMP); + } + else if(controlHeld&PI_LEFT) + { + if(_playerMode->canMoveLeft()) + _playerMode->setState(STATE_RUN); + } + else if(controlHeld&PI_RIGHT) + { + if(_playerMode->canMoveRight()) + _playerMode->setState(STATE_RUN); + } }