From 9ed37e68d2a5e413ec12487329361480bf290b7a Mon Sep 17 00:00:00 2001 From: Strangerke Date: Fri, 3 Jan 2014 08:10:40 +0100 Subject: AVALANCHE: Split AvalancheEngine::resetVariables() in two, to make a part of it reusable --- engines/avalanche/avalanche.cpp | 2 +- engines/avalanche/avalanche.h | 1 + engines/avalanche/avalot.cpp | 5 ++++- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/engines/avalanche/avalanche.cpp b/engines/avalanche/avalanche.cpp index 2bb927646e..06585cd98c 100644 --- a/engines/avalanche/avalanche.cpp +++ b/engines/avalanche/avalanche.cpp @@ -444,7 +444,7 @@ bool AvalancheEngine::loadGame(const int16 slot) { t.tm_mon = f->readSint16LE(); t.tm_year = f->readSint16LE(); - resetVariables(); + resetAllVariables(); Common::Serializer sz(f, NULL); synchronize(sz); diff --git a/engines/avalanche/avalanche.h b/engines/avalanche/avalanche.h index 87eb3c2158..7392bf3fae 100644 --- a/engines/avalanche/avalanche.h +++ b/engines/avalanche/avalanche.h @@ -340,6 +340,7 @@ private: void checkClick(); void fixFlashers(); void loadAlso(byte num); + void resetAllVariables(); void resetVariables(); }; diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp index 52ba3b2189..9555bb4505 100644 --- a/engines/avalanche/avalot.cpp +++ b/engines/avalanche/avalot.cpp @@ -1478,7 +1478,10 @@ void AvalancheEngine::resetVariables() { _givenPenToAyles = false; _askedDogfoodAboutNim = false; _startTime = getTimeInSeconds(); +} +void AvalancheEngine::resetAllVariables() { + resetVariables(); _parser->resetVariables(); _nim->resetVariables(); _animation->resetVariables(); @@ -1500,7 +1503,7 @@ void AvalancheEngine::newGame() { avvy->init(0, true); _alive = true; - resetVariables(); + resetAllVariables(); _dialogs->setBubbleStateNatural(); -- cgit v1.2.3