diff --git a/source/game/game.cpp b/source/game/game.cpp index 1e74d1f77..b3118ce71 100644 --- a/source/game/game.cpp +++ b/source/game/game.cpp @@ -78,7 +78,7 @@ int s_globalLevelSelectThing=0; int s_globalLevelSelectThing=1; #endif int CGameScene::s_readyToExit; -int exitToNextLevel; +int CGameScene::s_levelFinished; /*****************************************************************************/ @@ -140,7 +140,8 @@ void CGameScene::init() SetGeomScreen(GH); s_readyToExit=false; - exitToNextLevel=false; + s_levelFinished=false; + } /*****************************************************************************/ @@ -217,7 +218,7 @@ void CGameScene::think(int _frames) if(PadGetDown(0)&PAD_R2) { - exitToNextLevel=true; + levelFinished(); } } @@ -227,7 +228,7 @@ void CGameScene::think(int _frames) // Temporarily.. exiting game scene always goes back to the front end (pkg) GameState::setNextScene(&FrontEndScene); } - else if(exitToNextLevel) + else if(s_levelFinished) { s_globalLevelSelectThing++; GameState::setNextScene(&GameScene); diff --git a/source/game/game.h b/source/game/game.h index f2c70a305..9cc5654bb 100644 --- a/source/game/game.h +++ b/source/game/game.h @@ -36,6 +36,7 @@ virtual int canPause(); void sendEvent( GAME_EVENT evt, class CThing *sourceThing ); static void setReadyToExit() {s_readyToExit=true;} + static void levelFinished() {s_levelFinished=true;} protected: @@ -46,6 +47,7 @@ protected: static MATRIX CamMtx; static int s_readyToExit; + static int s_levelFinished; }; diff --git a/source/thing/thing.cpp b/source/thing/thing.cpp index 7726e1cfe..0340e9a33 100644 --- a/source/thing/thing.cpp +++ b/source/thing/thing.cpp @@ -148,6 +148,19 @@ void CThingManager::thinkAllThings(int _frames) thing1=thing1->m_nextThing; } + // Player -> Trigger collision + thing1=s_thingLists[CThing::TYPE_TRIGGER]; + thing2=s_thingLists[CThing::TYPE_PLAYER]; + while(thing1&&thing2) + { + if(thing1->canCollide()&& + thing1->checkCollisionAgainst(thing2)) + { + thing1->collidedWith(thing2); + } + thing1=thing1->m_nextThing; + } + } /*----------------------------------------------------------------------