[Scummvm-git-logs] scummvm branch-2-2 -> 9d03fbdd4c55d64ea52ae20bee2a6f3e0c48e092

antoniou79 a.antoniou79 at gmail.com
Wed Sep 9 21:55:12 UTC 2020


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:
886d245319 BLADERUNNER: Fix for ActorClues::getModifier and minor cleanup
9d03fbdd4c BLADERUNNER: Minor cleanup, comments update and a spelling fix


Commit: 886d24531921513e0026536a741cb6687972246d
    https://github.com/scummvm/scummvm/commit/886d24531921513e0026536a741cb6687972246d
Author: antoniou79 (a.antoniou79 at gmail.com)
Date: 2020-09-10T00:54:33+03:00

Commit Message:
BLADERUNNER: Fix for ActorClues::getModifier and minor cleanup

The weight var is supposed to be from the otherActor (2nd argument)

Also removed a redundant function and did some minor readbility changes

Changed paths:
    engines/bladerunner/actor_clues.cpp
    engines/bladerunner/actor_clues.h


diff --git a/engines/bladerunner/actor_clues.cpp b/engines/bladerunner/actor_clues.cpp
index fabc89b5ef..e42cc15184 100644
--- a/engines/bladerunner/actor_clues.cpp
+++ b/engines/bladerunner/actor_clues.cpp
@@ -71,7 +71,7 @@ void ActorClues::acquire(int clueId, bool flag2, int fromActorId) {
 		return;
 	} else {
 		_clues[clueIndex].flags |= 0x01;
-		_clues[clueIndex].flags = (_clues[clueIndex].flags & ~0x02) | ((flag2 << 1) & 0x02);
+		_clues[clueIndex].flags = (_clues[clueIndex].flags & ~0x02) | (((flag2? 1:0) << 1) & 0x02);
 		_clues[clueIndex].fromActorId = fromActorId;
 	// debug("Actor acquired clue: \"%s\" from %d", _vm->_crimesDatabase->getClueText(clueId), fromActorId);
 	}
@@ -105,10 +105,11 @@ int ActorClues::getWeight(int clueId) const {
 
 int ActorClues::getModifier(int actorId, int otherActorId, int clueId) {
 	Actor *actor = _vm->_actors[actorId];
+	Actor *otherActor = _vm->_actors[otherActorId];
 	int modifier1, modifier2, modifier3, modifier4;
 
 	int friendliness = actor->getFriendlinessToOther(otherActorId);
-	int clueWeight = actor->_clues->getWeight(clueId);
+	int clueWeight = otherActor->_clues->getWeight(clueId);
 
 	if (actor->_clues->isFlag2(clueId)) {
 		modifier1 = 100 - actor->getHonesty() - friendliness;
@@ -216,7 +217,7 @@ void ActorClues::acquireCluesByRelations(int actorId, int otherActorId) {
 	}
 }
 
-int ActorClues::findAcquirableCluesFromActor(int actorId, int targetActorId, CluesUS *list, int size) {
+int ActorClues::findAcquirableCluesFromActor(int actorId, int targetActorId, ActorClues::CluesUS *list, int size) {
 	Actor *actor = _vm->_actors[actorId];
 	Actor *otherActor = _vm->_actors[targetActorId];
 	int count = 0;
@@ -300,19 +301,6 @@ void ActorClues::setPrivate(int clueId, bool value) {
 	}
 }
 
-int ActorClues::getField1(int clueId) const {
-	if (!_count) {
-		return 0;
-	}
-
-	int clueIndex = findClueIndex(clueId);
-	if (clueIndex == -1) {
-		return 0;
-	}
-
-	return _clues[clueIndex].weight;
-}
-
 int ActorClues::getCount() const {
 	return _count;
 }
@@ -349,8 +337,8 @@ void ActorClues::add(int actorId, int clueId, int weight, bool acquired, bool un
 	_clues[_count].weight = weight;
 
 	_clues[_count].flags = 0;
-	_clues[_count].flags = (_clues[_count].flags & ~0x01) | (acquired & 0x01);
-	_clues[_count].flags = (_clues[_count].flags & ~0x02) | ((unknownFlag << 1) & 0x02);
+	_clues[_count].flags = (_clues[_count].flags & ~0x01) | ((acquired? 1:0) & 0x01);
+	_clues[_count].flags = (_clues[_count].flags & ~0x02) | (((unknownFlag? 1:0) << 1) & 0x02);
 
 	_clues[_count].fromActorId = fromActorId;
 	++_count;
diff --git a/engines/bladerunner/actor_clues.h b/engines/bladerunner/actor_clues.h
index 8de4190f79..617426ee28 100644
--- a/engines/bladerunner/actor_clues.h
+++ b/engines/bladerunner/actor_clues.h
@@ -86,8 +86,6 @@ public:
 	bool isPrivate(int clueId) const;
 	void setPrivate(int clueId, bool value);
 
-	int getField1(int clueId) const;
-
 	int getCount() const;
 	int getClueIdByIndex(int index) const;
 


Commit: 9d03fbdd4c55d64ea52ae20bee2a6f3e0c48e092
    https://github.com/scummvm/scummvm/commit/9d03fbdd4c55d64ea52ae20bee2a6f3e0c48e092
Author: antoniou79 (a.antoniou79 at gmail.com)
Date: 2020-09-10T00:54:53+03:00

Commit Message:
BLADERUNNER: Minor cleanup, comments update and a spelling fix

Changed paths:
    engines/bladerunner/game_constants.h
    engines/bladerunner/script/ai/lucy.cpp
    engines/bladerunner/script/ai_script.cpp
    engines/bladerunner/script/init_script.cpp
    engines/bladerunner/script/scene/ma02.cpp
    engines/bladerunner/script/scene/ug02.cpp


diff --git a/engines/bladerunner/game_constants.h b/engines/bladerunner/game_constants.h
index d2ab0ae694..433ec4a1b2 100644
--- a/engines/bladerunner/game_constants.h
+++ b/engines/bladerunner/game_constants.h
@@ -1095,7 +1095,7 @@ enum Flags {
 	kFlagMcCoyIsHelpingReplicants             = 653,
 	kFlagMA02Chapter5Started                  = 654,
 	kFlagMA02RajifTalk                        = 655,
-	kFlagUG02RagiationGooglesTaken            = 656,
+	kFlagUG02RadiationGogglesTaken            = 656,
 	kFlagNotUsed657                           = 657, // is never set
 	kFlagKP07Entered                          = 658,
 	kFlagNR11BreakWindow                      = 659,
diff --git a/engines/bladerunner/script/ai/lucy.cpp b/engines/bladerunner/script/ai/lucy.cpp
index 24d1196393..8ba4862f81 100644
--- a/engines/bladerunner/script/ai/lucy.cpp
+++ b/engines/bladerunner/script/ai/lucy.cpp
@@ -88,7 +88,7 @@ bool AIScriptLucy::Update() {
 	 && !Player_Query_Combat_Mode()
 	 &&  Actor_Query_Friendliness_To_Other(kActorLucy, kActorMcCoy) > 40
 	) {
-		Actor_Set_Goal_Number(kActorLucy, kGoalLucyHF04TalkToMcCoy); // how can this be triggered?
+		Actor_Set_Goal_Number(kActorLucy, kGoalLucyHF04TalkToMcCoy); // TODO how can this be triggered?
 	}
 
 	if (Actor_Query_Goal_Number(kActorLucy) == kGoalLucyHF04WaitForMcCoy1) {
diff --git a/engines/bladerunner/script/ai_script.cpp b/engines/bladerunner/script/ai_script.cpp
index a2dbaef6c5..8a08d1b1c9 100644
--- a/engines/bladerunner/script/ai_script.cpp
+++ b/engines/bladerunner/script/ai_script.cpp
@@ -358,7 +358,7 @@ void AIScripts::setAnimationState(int actor, int animationState, int animationFr
 
 
 void AIScripts::queryAnimationState(int actor, int *animationState, int *animationFrame, int *animationStateNext, int *animationNext) {
-		if (actor >= _actorCount) {
+	if (actor >= _actorCount) {
 		return;
 	}
 
diff --git a/engines/bladerunner/script/init_script.cpp b/engines/bladerunner/script/init_script.cpp
index a15bb768f1..8954f1cd46 100644
--- a/engines/bladerunner/script/init_script.cpp
+++ b/engines/bladerunner/script/init_script.cpp
@@ -559,7 +559,7 @@ void InitScript::Init_Clues2() {
 
 #define IMPORT_CLUE_TABLE(a, arr) \
 	for (int i = 0; i != ARRAYSIZE(arr); ++i) {\
-		Actor_Clue_Add_To_Database( a, arr[i].clue, arr[i].weight, 0, 0, -1);\
+		Actor_Clue_Add_To_Database( a, arr[i].clue, arr[i].weight, false, false, -1);\
 	}
 
 	IMPORT_CLUE_TABLE(kActorSteele, ClueWeightsForSteele);
diff --git a/engines/bladerunner/script/scene/ma02.cpp b/engines/bladerunner/script/scene/ma02.cpp
index 40a59362a8..0cae6d443f 100644
--- a/engines/bladerunner/script/scene/ma02.cpp
+++ b/engines/bladerunner/script/scene/ma02.cpp
@@ -42,8 +42,7 @@ void SceneScriptMA02::InitializeScene() {
 	Scene_Exit_Add_2D_Exit(kMA02ExitMA06, 538, 84, 639, 327, 1);
 	Scene_Exit_Add_2D_Exit(kMA02ExitMA04,  56, 98, 150, 260, 0);
 
-	if (Global_Variable_Query(kVariableChapter) >= 4
-	 && Global_Variable_Query(kVariableChapter) == 5
+	if (Global_Variable_Query(kVariableChapter) == 5
 	 && Game_Flag_Query(kFlagMcCoyIsHelpingReplicants)
 	) {
 		Actor_Set_Goal_Number(kActorMaggie, kGoalMaggieDead);
diff --git a/engines/bladerunner/script/scene/ug02.cpp b/engines/bladerunner/script/scene/ug02.cpp
index 70bb261809..cdb0e31985 100644
--- a/engines/bladerunner/script/scene/ug02.cpp
+++ b/engines/bladerunner/script/scene/ug02.cpp
@@ -70,7 +70,7 @@ void SceneScriptUG02::SceneLoaded() {
 	Footstep_Sounds_Set(0, 0);
 	Footstep_Sounds_Set(8, 2);
 
-	if (!Game_Flag_Query(kFlagUG02RagiationGooglesTaken)
+	if (!Game_Flag_Query(kFlagUG02RadiationGogglesTaken)
 	  && Game_Flag_Query(kFlagIzoIsReplicant)
 	) {
 		Item_Add_To_World(kItemRadiationGoogles, kModelAnimationRadiationGoggles, kSetUG02, -300.37f, 120.16f, -81.31f, 0, 8, 8, false, true, false, true);
@@ -162,7 +162,7 @@ bool SceneScriptUG02::ClickedOnItem(int itemId, bool a2) {
 	if (itemId == kItemRadiationGoogles) {
 		Actor_Face_Item(kActorMcCoy, kItemRadiationGoogles, true);
 		Actor_Clue_Acquire(kActorMcCoy, kClueRadiationGoggles, true, -1);
-		Game_Flag_Set(kFlagUG02RagiationGooglesTaken);
+		Game_Flag_Set(kFlagUG02RadiationGogglesTaken);
 		Item_Remove_From_World(kItemRadiationGoogles);
 		Item_Pickup_Spin_Effect(kModelAnimationRadiationGoggles, 426, 316);
 		return true;




More information about the Scummvm-git-logs mailing list