From 2dfc0db9c4fc23c994496d68516ffbc9f5bca8dc Mon Sep 17 00:00:00 2001 From: Paul Date: Tue, 12 Jun 2001 21:45:33 +0000 Subject: [PATCH] --- source/game/game.cpp | 4 ++++ source/pickups/pquest.cpp | 6 +++++- source/player/player.cpp | 1 + source/player/player.h | 3 +++ source/triggers/tlevexit.cpp | 9 ++++++++- 5 files changed, 21 insertions(+), 2 deletions(-) diff --git a/source/game/game.cpp b/source/game/game.cpp index 198fc0159..9a63c4175 100644 --- a/source/game/game.cpp +++ b/source/game/game.cpp @@ -448,6 +448,10 @@ void CGameScene::initLevel() createPlayer(); m_player->setRespawnPos(Level.getPlayerSpawnPos()); m_player->init(); + if(getLevelNumber()==5) + { + m_player->setCanExitLevelNow(); + } DVECTOR mapSize=Level.getMapSize(); CPlayer::CameraBox camBox={0,0,mapSize.vx<<4,mapSize.vy<<4}; m_player->setCameraBox(camBox); diff --git a/source/pickups/pquest.cpp b/source/pickups/pquest.cpp index c60485ea0..f2aa4b061 100644 --- a/source/pickups/pquest.cpp +++ b/source/pickups/pquest.cpp @@ -37,6 +37,10 @@ #include "game\game.h" #endif +#ifndef __PLAYER_PLAYER_H__ +#include "player\player.h" +#endif + /* Std Lib ------- */ @@ -168,7 +172,7 @@ DVECTOR CQuestItemPickup::getSizeForPlacement() ---------------------------------------------------------------------- */ void CQuestItemPickup::collect(class CPlayer *_player) { - CGameScene::levelFinished(); + _player->setCanExitLevelNow(); CBasePickup::collect(_player); } diff --git a/source/player/player.cpp b/source/player/player.cpp index a9058c21e..497f5f498 100644 --- a/source/player/player.cpp +++ b/source/player/player.cpp @@ -637,6 +637,7 @@ m_animFrame=0; m_currentPlayerModeClass=NULL; m_lastModeBeforeDeath=PLAYER_MODE_FULLUNARMED; // Player will then respawn into this mode m_lives++;respawn(); + m_canExitLevel=false; m_lives=CGameSlotManager::getSlotData()->m_lives; diff --git a/source/player/player.h b/source/player/player.h index 37b1dcf40..0a6f600ca 100644 --- a/source/player/player.h +++ b/source/player/player.h @@ -273,6 +273,8 @@ public: void takeDamage(DAMAGE_TYPE _damage,REACT_DIRECTION _reactDirection=REACT__UP,CThing *_thing=NULL); void respawn(); + void setCanExitLevelNow() {m_canExitLevel=true;} + int getCanExitLevelNow() {return m_canExitLevel;} int getLivesLeft() {return m_lives;} @@ -355,6 +357,7 @@ private: CameraBox m_cameraPosLimitBox; CameraBox m_playerPosLimitBox; DVECTOR m_respawnPos; + int m_canExitLevel; diff --git a/source/triggers/tlevexit.cpp b/source/triggers/tlevexit.cpp index 2ac09082d..d3732ac02 100644 --- a/source/triggers/tlevexit.cpp +++ b/source/triggers/tlevexit.cpp @@ -22,6 +22,10 @@ #include "game\game.h" #endif +#ifndef __PLAYER_PLAYER_H__ +#include "player\player.h" +#endif + /* Std Lib ------- */ @@ -101,7 +105,10 @@ void CLevelExitTrigger::collidedWith(CThing *_thisThing) case TYPE_PLAYER: { #if !defined (__USER_art__) && !defined (__USER_sbart__) - CGameScene::levelFinished(); + if(((CPlayer*)_thisThing)->getCanExitLevelNow()) + { + CGameScene::levelFinished(); + } #endif break; }