This commit is contained in:
parent
2a6beb64f7
commit
bccc161ff2
2 changed files with 19 additions and 10 deletions
|
@ -462,18 +462,27 @@ const struct PlayerMetrics *CPlayerModeBase::getPlayerMetrics()
|
|||
---------------------------------------------------------------------- */
|
||||
int CPlayerModeBase::setState(int _state)
|
||||
{
|
||||
CPlayerState *nextState;
|
||||
int ret=false;
|
||||
|
||||
nextState=getStateTable()[_state];
|
||||
if(nextState)
|
||||
if(m_currentState==STATE_CELEBRATE&&_state!=STATE_IDLE)
|
||||
{
|
||||
m_player->resetPlayerCollisionSizeToBase();
|
||||
m_currentStateClass=nextState;
|
||||
m_currentStateClass->enter(this);
|
||||
m_currentState=(PLAYER_STATE)_state;
|
||||
ret=true;
|
||||
}
|
||||
else
|
||||
{
|
||||
CPlayerState *nextState;
|
||||
|
||||
nextState=getStateTable()[_state];
|
||||
if(nextState)
|
||||
{
|
||||
m_player->resetPlayerCollisionSizeToBase();
|
||||
m_currentStateClass=nextState;
|
||||
m_currentStateClass->enter(this);
|
||||
m_currentState=(PLAYER_STATE)_state;
|
||||
ret=true;
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue