From d969b1b11b7c5d95d933b34f99f14b59f7de4bbb Mon Sep 17 00:00:00 2001 From: Matthew Hoops Date: Sun, 28 Jul 2013 14:31:46 -0400 Subject: PEGASUS: Fix gas canister removal not stopping the air timer This bug was also in the original --- engines/pegasus/neighborhood/norad/alpha/fillingstation.cpp | 2 +- engines/pegasus/neighborhood/norad/alpha/noradalpha.cpp | 2 +- engines/pegasus/neighborhood/norad/norad.cpp | 4 +++- 3 files changed, 5 insertions(+), 3 deletions(-) (limited to 'engines/pegasus') diff --git a/engines/pegasus/neighborhood/norad/alpha/fillingstation.cpp b/engines/pegasus/neighborhood/norad/alpha/fillingstation.cpp index 169f75f7d2..3491f161c7 100644 --- a/engines/pegasus/neighborhood/norad/alpha/fillingstation.cpp +++ b/engines/pegasus/neighborhood/norad/alpha/fillingstation.cpp @@ -201,7 +201,7 @@ void NoradAlphaFillingStation::showIntakeInProgress(uint16 numSeconds) { if (item->getObjectID() == kGasCanister) { GameState.setNoradGassed(true); - ((NoradAlpha *)getOwner())->loadAmbientLoops(); + ((NoradAlpha *)getOwner())->checkAirMask(); getOwner()->restoreStriding(kNorad03, kEast, kAltNoradAlphaNormal); } } else { diff --git a/engines/pegasus/neighborhood/norad/alpha/noradalpha.cpp b/engines/pegasus/neighborhood/norad/alpha/noradalpha.cpp index e4a5e26473..6a24113465 100644 --- a/engines/pegasus/neighborhood/norad/alpha/noradalpha.cpp +++ b/engines/pegasus/neighborhood/norad/alpha/noradalpha.cpp @@ -576,7 +576,7 @@ void NoradAlpha::takeItemFromRoom(Item *item) { if (_fillingStationItem == item) { _fillingStationItem = 0; GameState.setNoradGassed(false); - loadAmbientLoops(); + checkAirMask(); ((NoradAlphaFillingStation *)_currentInteraction)->newFillingItem(0); forceStridingStop(kNorad03, kEast, kAltNoradAlphaNormal); } diff --git a/engines/pegasus/neighborhood/norad/norad.cpp b/engines/pegasus/neighborhood/norad/norad.cpp index 578f062dea..53b3ff9add 100644 --- a/engines/pegasus/neighborhood/norad/norad.cpp +++ b/engines/pegasus/neighborhood/norad/norad.cpp @@ -241,7 +241,9 @@ void Norad::setUpAirMask() { } void Norad::checkAirMask() { - if (g_airMask && g_airMask->isAirFilterOn()) { + // WORKAROUND: The original game forgot to handle the case where the canister would + // be removed, leading to the timer remaining active. + if (!GameState.getNoradGassed() || (g_airMask && g_airMask->isAirFilterOn())) { _airMaskTimer.stop(); } else if (GameState.getNoradGassed() && !_airMaskTimer.isRunning()) { _airMaskTimer.setTime(0); -- cgit v1.2.3