This commit is contained in:
parent
ed08839edd
commit
599c18dc1c
@ -722,9 +722,9 @@ if(newmode!=-1)
|
||||
platform=isOnPlatform();
|
||||
if(platform)
|
||||
{
|
||||
if ( ( (CNpcPlatform *) platform )->isCart() )
|
||||
if ( m_currentMode != PLAYER_MODE_CART && m_currentMode != PLAYER_MODE_DEAD )
|
||||
{
|
||||
if ( m_currentMode != PLAYER_MODE_CART && m_currentMode != PLAYER_MODE_DEAD )
|
||||
if ( ( (CNpcPlatform *) platform )->isCart() )
|
||||
{
|
||||
setMode( PLAYER_MODE_CART );
|
||||
}
|
||||
@ -1616,6 +1616,7 @@ void CPlayer::setMode(PLAYER_MODE _mode)
|
||||
}
|
||||
m_currentMode=_mode;
|
||||
m_currentPlayerModeClass=s_playerModes[_mode];
|
||||
m_currentPlayerModeClass->setInitialState(state);
|
||||
if(!m_currentPlayerModeClass->setState(state))
|
||||
{
|
||||
m_currentPlayerModeClass->setState(STATE_IDLE);
|
||||
|
@ -87,6 +87,7 @@ public:
|
||||
virtual void initialise(class CPlayer *_player) {m_player=_player;}
|
||||
virtual void shutdown() {;}
|
||||
virtual void enter() {;}
|
||||
virtual void setInitialState(int _state) {;}
|
||||
virtual void think() {;}
|
||||
virtual void render(DVECTOR *_pos) {;}
|
||||
virtual void renderModeUi() {;} // Ui specific to this mode (eg: ammo)
|
||||
@ -128,6 +129,7 @@ public:
|
||||
};
|
||||
|
||||
virtual void enter();
|
||||
virtual void setInitialState(int _state) {m_currentState=(PLAYER_STATE)_state;}
|
||||
virtual void think();
|
||||
virtual void render() {;}
|
||||
virtual int canDoLookAround();
|
||||
|
@ -69,12 +69,16 @@ CPlayerStateJump s_stateJump;
|
||||
---------------------------------------------------------------------- */
|
||||
void CPlayerStateJump::enter(CPlayerModeBase *_playerMode)
|
||||
{
|
||||
_playerMode->setAnimNo(ANIM_SPONGEBOB_JUMP);
|
||||
m_jumpFrames=0;
|
||||
// If already in this state then don't do the entry code
|
||||
if(_playerMode->getState()!=STATE_JUMP)
|
||||
{
|
||||
_playerMode->setAnimNo(ANIM_SPONGEBOB_JUMP);
|
||||
m_jumpFrames=0;
|
||||
|
||||
_playerMode->jump();
|
||||
_playerMode->jump();
|
||||
|
||||
CSoundMediator::playSfx(CSoundMediator::SFX_SPONGEBOB_JUMP);
|
||||
CSoundMediator::playSfx(CSoundMediator::SFX_SPONGEBOB_JUMP);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user