[Scummvm-git-logs] scummvm master -> ae95bcf31f0a4558b7f7dd96a2afcfcf52cf45ec

peterkohaut peterkohaut at users.noreply.github.com
Thu Mar 8 23:15:31 CET 2018


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

Summary:
ae95bcf31f BLADERUNNER: Fixed Hysteria Iall door & rotating floor


Commit: ae95bcf31f0a4558b7f7dd96a2afcfcf52cf45ec
    https://github.com/scummvm/scummvm/commit/ae95bcf31f0a4558b7f7dd96a2afcfcf52cf45ec
Author: Peter Kohaut (peter.kohaut at gmail.com)
Date: 2018-03-08T23:15:21+01:00

Commit Message:
BLADERUNNER: Fixed Hysteria Iall door & rotating floor

Changed paths:
    engines/bladerunner/script/ai/mccoy.cpp
    engines/bladerunner/script/scene/nr05.cpp
    engines/bladerunner/script/scene_script.h


diff --git a/engines/bladerunner/script/ai/mccoy.cpp b/engines/bladerunner/script/ai/mccoy.cpp
index add613e..554de0c 100644
--- a/engines/bladerunner/script/ai/mccoy.cpp
+++ b/engines/bladerunner/script/ai/mccoy.cpp
@@ -588,7 +588,7 @@ bool AIScriptMcCoy::UpdateAnimation(int *animation, int *frame) {
 		if (_animationFrame < Slice_Animation_Query_Number_Of_Frames(41) - 1) {
 			_animationFrame++;
 		}
-		return true;
+		break;
 	case 59:
 		*animation = 48;
 		_animationFrame++;
diff --git a/engines/bladerunner/script/scene/nr05.cpp b/engines/bladerunner/script/scene/nr05.cpp
index e8608f4..9552734 100644
--- a/engines/bladerunner/script/scene/nr05.cpp
+++ b/engines/bladerunner/script/scene/nr05.cpp
@@ -148,8 +148,8 @@ void SceneScriptNR05::SceneFrameAdvanced(int frame) {
 	if (frame == 86) {
 		Sound_Play(353, 62, 70, 70, 50);
 	}
-	sub_402A48(48);
-	sub_402A48(0);
+	rotateActorOnGround(kActorHysteriaPatron2);
+	rotateActorOnGround(kActorMcCoy);
 	if (Actor_Query_Goal_Number(kActorEarlyQ) == 224) {
 		Actor_Set_Goal_Number(kActorEarlyQ, 225);
 		if (Player_Query_Current_Scene() == 58) {
@@ -157,7 +157,7 @@ void SceneScriptNR05::SceneFrameAdvanced(int frame) {
 		}
 	}
 	if (frame > 77 && frame <= 134) {
-		sub_401F74(frame - 13);
+		rotateActorOnTable(frame - 13);
 		if (frame == 134 && !Game_Flag_Query(537)) {
 			Actor_Set_Goal_Number(kActorMcCoy, 200);
 		}
@@ -167,7 +167,6 @@ void SceneScriptNR05::SceneFrameAdvanced(int frame) {
 		//return false;
 		return;
 	}
-
 }
 
 void SceneScriptNR05::ActorChangedGoal(int actorId, int newGoal, int oldGoal, bool currentSet) {
@@ -193,7 +192,7 @@ void SceneScriptNR05::PlayerWalkedOut() {
 void SceneScriptNR05::DialogueQueueFlushed(int a1) {
 }
 
-void SceneScriptNR05::sub_401F74(int frame) {
+void SceneScriptNR05::rotateActorOnTable(int frame) {
 	float angle = cos((frame - 65) * (M_PI / 57.0f)) * M_PI_2;
 	float invertedAngle = M_PI - angle;
 	if (!Game_Flag_Query(537)) {
@@ -329,14 +328,16 @@ void SceneScriptNR05::sub_4022DC() {
 	}
 }
 
-void SceneScriptNR05::sub_402A48(int actorId) {
+void SceneScriptNR05::rotateActorOnGround(int actorId) {
 	int animationMode = Actor_Query_Animation_Mode(actorId);
-	if (animationMode == 1 || animationMode == 2 || animationMode == 7 || animationMode == 8) {
+	if (animationMode == kAnimationModeWalk || animationMode == kAnimationModeRun || animationMode == kAnimationModeCombatWalk || animationMode == kAnimationModeCombatRun) {
 		return;
 	}
 	float x, y, z;
 	Actor_Query_XYZ(actorId, &x, &y, &z);
-	if ((x - -542.0f) * (x - -542.0f) + (z - -195.0f) * (z - -195.0f) < 8464.0f) {
+	x -= -542.0f;
+	z -= -195.0f;
+	if (x * x + z * z < 92.0f * 92.0f) {
 		float s = sin(M_PI / 128.0f);
 		float c = cos(M_PI / 128.0f);
 		float newX = x * c - z * s + -542.0f;
diff --git a/engines/bladerunner/script/scene_script.h b/engines/bladerunner/script/scene_script.h
index 1c0d95f..54047ed 100644
--- a/engines/bladerunner/script/scene_script.h
+++ b/engines/bladerunner/script/scene_script.h
@@ -313,10 +313,10 @@ DECLARE_SCRIPT(NR04)
 END_SCRIPT
 
 DECLARE_SCRIPT(NR05)
-	void sub_401F74(int frame);
+	void rotateActorOnTable(int frame);
 	void sub_4020B4();
 	void sub_4022DC();
-	void sub_402A48(int actorId);
+	void rotateActorOnGround(int actorId);
 	void sub_402B9C();
 END_SCRIPT
 





More information about the Scummvm-git-logs mailing list