[Scummvm-git-logs] scummvm master -> 2003c12bc3fcdd8540cbe8942c86980f2d1b2131

antoniou79 antoniou at cti.gr
Tue Sep 10 18:21:33 CEST 2019


This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
bef3f902e6 BLADERUNNER: Add DebugMan.clearAllDebugChannels() in shutdown
2003c12bc3 BLADERUNNER: Move shutdown() in Engine destructor


Commit: bef3f902e693a4f17fef896d8a991077d1a602a6
    https://github.com/scummvm/scummvm/commit/bef3f902e693a4f17fef896d8a991077d1a602a6
Author: Thanasis Antoniou (a.antoniou79 at gmail.com)
Date: 2019-09-10T19:18:45+03:00

Commit Message:
BLADERUNNER: Add DebugMan.clearAllDebugChannels() in shutdown

Changed paths:
    engines/bladerunner/bladerunner.cpp
    engines/bladerunner/script/ai/dektora.cpp
    engines/bladerunner/script/ai/mutant3.cpp


diff --git a/engines/bladerunner/bladerunner.cpp b/engines/bladerunner/bladerunner.cpp
index 2cea816..a2fa003 100644
--- a/engines/bladerunner/bladerunner.cpp
+++ b/engines/bladerunner/bladerunner.cpp
@@ -715,6 +715,8 @@ void BladeRunnerEngine::initChapterAndScene() {
 }
 
 void BladeRunnerEngine::shutdown() {
+	DebugMan.clearAllDebugChannels();
+
 	_mixer->stopAll();
 
 	// BLADE.INI as updated here
@@ -2186,7 +2188,7 @@ void BladeRunnerEngine::newGame(int difficulty) {
 	for (uint i = 0; i < _gameInfo->getActorCount(); ++i) {
 		_actors[i]->setup(i);
 	}
-	_actors[kActorVoiceOver]->setup(99);
+	_actors[kActorVoiceOver]->setup(kActorVoiceOver);
 
 	for (uint i = 0; i < _gameInfo->getSuspectCount(); ++i) {
 		_suspectsDatabase->get(i)->reset();
diff --git a/engines/bladerunner/script/ai/dektora.cpp b/engines/bladerunner/script/ai/dektora.cpp
index 70b081f..63fe72a 100644
--- a/engines/bladerunner/script/ai/dektora.cpp
+++ b/engines/bladerunner/script/ai/dektora.cpp
@@ -320,7 +320,7 @@ bool AIScriptDektora::ShotAtAndHit() {
 
 void AIScriptDektora::Retired(int byActorId) {
 	if (byActorId == kActorMcCoy) {
-		Actor_Modify_Friendliness_To_Other(kActorClovis, 0, -5);
+		Actor_Modify_Friendliness_To_Other(kActorClovis, kActorMcCoy, -5);
 	}
 
 	if (byActorId == kActorSteele
diff --git a/engines/bladerunner/script/ai/mutant3.cpp b/engines/bladerunner/script/ai/mutant3.cpp
index fbc41d7..06f97cd 100644
--- a/engines/bladerunner/script/ai/mutant3.cpp
+++ b/engines/bladerunner/script/ai/mutant3.cpp
@@ -151,14 +151,14 @@ void AIScriptMutant3::OtherAgentEnteredCombatMode(int otherActorId, int combatMo
 void AIScriptMutant3::ShotAtAndMissed() {
 	if (Actor_Query_Goal_Number(kActorMutant3) != 410) {
 		Actor_Modify_Combat_Aggressiveness(kActorMutant3, 15);
-		Actor_Modify_Friendliness_To_Other(kActorMutant3, 0, -15);
+		Actor_Modify_Friendliness_To_Other(kActorMutant3, kActorMcCoy, -15);
 	}
 }
 
 bool AIScriptMutant3::ShotAtAndHit() {
 	if (Actor_Query_Goal_Number(kActorMutant3) != 410) {
 		Actor_Modify_Combat_Aggressiveness(kActorMutant3, 20);
-		Actor_Modify_Friendliness_To_Other(kActorMutant3, 0, -20);
+		Actor_Modify_Friendliness_To_Other(kActorMutant3, kActorMcCoy, -20);
 	}
 	return false;
 }


Commit: 2003c12bc3fcdd8540cbe8942c86980f2d1b2131
    https://github.com/scummvm/scummvm/commit/2003c12bc3fcdd8540cbe8942c86980f2d1b2131
Author: Thanasis Antoniou (a.antoniou79 at gmail.com)
Date: 2019-09-10T19:18:45+03:00

Commit Message:
BLADERUNNER: Move shutdown() in Engine destructor

Changed paths:
    engines/bladerunner/bladerunner.cpp


diff --git a/engines/bladerunner/bladerunner.cpp b/engines/bladerunner/bladerunner.cpp
index a2fa003..e83c811 100644
--- a/engines/bladerunner/bladerunner.cpp
+++ b/engines/bladerunner/bladerunner.cpp
@@ -226,6 +226,7 @@ BladeRunnerEngine::BladeRunnerEngine(OSystem *syst, const ADGameDescription *des
 }
 
 BladeRunnerEngine::~BladeRunnerEngine() {
+	shutdown();
 }
 
 bool BladeRunnerEngine::hasFeature(EngineFeature f) const {
@@ -322,7 +323,7 @@ Common::Error BladeRunnerEngine::run() {
 			}
 			missingFileStr += missingFiles[i];
 		}
-
+		// shutting down
 		return Common::Error(Common::kNoGameDataFoundError, missingFileStr);
 	}
 
@@ -335,7 +336,7 @@ Common::Error BladeRunnerEngine::run() {
 	bool hasSavegames = !SaveFileManager::list(_targetName).empty();
 
 	if (!startup(hasSavegames)) {
-		shutdown();
+		// shutting down
 		return Common::Error(Common::kUnknownError, _("Failed to initialize resources"));
 	}
 
@@ -402,8 +403,7 @@ Common::Error BladeRunnerEngine::run() {
 		}
 	} while (_gameOver); // if main game loop ended and _gameOver == false, then shutdown
 
-	shutdown();
-
+	// shutting down
 	return Common::kNoError;
 }
 
@@ -798,7 +798,11 @@ void BladeRunnerEngine::shutdown() {
 	_playerActor = nullptr;
 	delete _actors[kActorVoiceOver];
 	_actors[kActorVoiceOver] = nullptr;
-	int actorCount = (int)_gameInfo->getActorCount();
+	int actorCount = kActorCount;
+	if (_gameInfo) {
+		actorCount = (int)_gameInfo->getActorCount();
+	}
+
 	for (int i = 0; i < actorCount; ++i) {
 		delete _actors[i];
 		_actors[i] = nullptr;





More information about the Scummvm-git-logs mailing list