diff options
Diffstat (limited to 'engines')
-rw-r--r-- | engines/pegasus/pegasus.cpp | 29 | ||||
-rw-r--r-- | engines/pegasus/pegasus.h | 2 |
2 files changed, 20 insertions, 11 deletions
diff --git a/engines/pegasus/pegasus.cpp b/engines/pegasus/pegasus.cpp index 61a2383738..de2e7f422d 100644 --- a/engines/pegasus/pegasus.cpp +++ b/engines/pegasus/pegasus.cpp @@ -1255,17 +1255,22 @@ void PegasusEngine::useNeighborhood(Neighborhood *neighborhood) { } } -void PegasusEngine::performJump(const tNeighborhoodID neighborhoodID) { +void PegasusEngine::performJump(tNeighborhoodID neighborhoodID) { + if (_neighborhood) + useNeighborhood(0); + // Sub chase is special if (neighborhoodID == kNoradSubChaseID) { throwAwayEverything(); doSubChase(); - jumpToNewEnvironment(kNoradDeltaID, kNorad41, kEast); - return; - } - if (_neighborhood) - useNeighborhood(0); + if (shouldQuit()) + return; + + neighborhoodID = kNoradDeltaID; + GameState.setNextRoom(kNorad41); + GameState.setNextDirection(kEast); + } Neighborhood *neighborhood; makeNeighborhood(neighborhoodID, neighborhood); @@ -1273,10 +1278,10 @@ void PegasusEngine::performJump(const tNeighborhoodID neighborhoodID) { } void PegasusEngine::startNeighborhood() { - if (_currentItemID != kNoItemID) + if (g_interface && _currentItemID != kNoItemID) g_interface->setCurrentInventoryItemID(_currentItemID); - if (_currentBiochipID != kNoItemID) + if (g_interface && _currentBiochipID != kNoItemID) g_interface->setCurrentBiochipID(_currentBiochipID); setGameMode(kModeNavigation); @@ -1344,7 +1349,7 @@ void PegasusEngine::startNewGame() { void PegasusEngine::makeNeighborhood(tNeighborhoodID neighborhoodID, Neighborhood *&neighborhood) { // TODO: CD check - + switch (neighborhoodID) { case kCaldoriaID: neighborhood = new Caldoria(g_AIArea, this); @@ -1367,8 +1372,12 @@ void PegasusEngine::makeNeighborhood(tNeighborhoodID neighborhoodID, Neighborhoo case kNoradAlphaID: neighborhood = new NoradAlpha(g_AIArea, this); break; + case kNoradDeltaID: + createInterface(); + error("TODO: Norad Delta"); + break; default: - error("Unhandled neighborhood %d", neighborhoodID); + error("Unknown neighborhood %d", neighborhoodID); } } diff --git a/engines/pegasus/pegasus.h b/engines/pegasus/pegasus.h index f79219447f..2dcd317b07 100644 --- a/engines/pegasus/pegasus.h +++ b/engines/pegasus/pegasus.h @@ -265,7 +265,7 @@ private: // Neighborhood Neighborhood *_neighborhood; void useNeighborhood(Neighborhood *neighborhood); - void performJump(const tNeighborhoodID start); + void performJump(tNeighborhoodID start); void startNewGame(); void startNeighborhood(); void makeNeighborhood(tNeighborhoodID, Neighborhood *&); |