diff --git a/source/game/game.cpp b/source/game/game.cpp index cae055b25..73681f869 100644 --- a/source/game/game.cpp +++ b/source/game/game.cpp @@ -134,6 +134,7 @@ CGameScene::ACTOR_TYPE CGameScene::actorType[40] = int s_globalLevelSelectThing=0; int CGameScene::s_readyToExit; int CGameScene::s_levelFinished; +int CGameScene::s_restartLevel; /*****************************************************************************/ @@ -170,6 +171,7 @@ void CGameScene::init() m_pauseMenu->init(); s_readyToExit=false; + s_restartLevel=false; CFader::setFadingIn(); initLevel(); @@ -241,6 +243,11 @@ void CGameScene::think(int _frames) initLevel(); s_levelFinished=false; } + else if (s_restartLevel) + { + respawnLevel(); + s_restartLevel=false; + } if(!m_pauseMenu->isActive()&&PadGetDown(0)&PAD_START&&canPause()) @@ -284,6 +291,7 @@ CPlayer * CGameScene::getPlayer() /*****************************************************************************/ void CGameScene::respawnLevel() { + m_player->respawn(); Level.respawnLevel(); } diff --git a/source/game/game.h b/source/game/game.h index 10f385eaf..fa4236aef 100644 --- a/source/game/game.h +++ b/source/game/game.h @@ -45,6 +45,7 @@ virtual int canPause(); static void setReadyToExit() {s_readyToExit=true;} static void levelFinished() {s_levelFinished=true;} +static void restartlevel() {s_restartLevel=true;} // static MATRIX &GetCamMtx() {return(CamMtx);} static ACTOR_TYPE getActorType( int actorNum ) {return actorType[actorNum];} @@ -62,6 +63,7 @@ class CPlayer *m_player; static FontBank *s_genericFont; static MATRIX CamMtx; +static int s_restartLevel; static int s_readyToExit; static int s_levelFinished;