aboutsummaryrefslogtreecommitdiff
path: root/engines/bladerunner/script/ai
diff options
context:
space:
mode:
authorThanasis Antoniou2019-11-05 02:14:43 +0200
committerThanasis Antoniou2019-11-05 02:17:17 +0200
commit1428aae3572f0ff2b389699df539c51a0527c4f9 (patch)
treedf66c33948aedfecff2066902b5d162de515feb0 /engines/bladerunner/script/ai
parent8c063e95c2127c382d0ad0c5e77a83e44ef3c704 (diff)
downloadscummvm-rg350-1428aae3572f0ff2b389699df539c51a0527c4f9.tar.gz
scummvm-rg350-1428aae3572f0ff2b389699df539c51a0527c4f9.tar.bz2
scummvm-rg350-1428aae3572f0ff2b389699df539c51a0527c4f9.zip
BLADERUNNER: #11239 Fix buggy state and saved games for Desk Clerk
Resolves ticket #11239 Occurs when McCoy leaves the scene with Leon and Desk Clerk too fast, before Leon drops the clerk Crash happens only when using CDFRAMES, but the animation would be bugged even when using HDFRAMES.DAT
Diffstat (limited to 'engines/bladerunner/script/ai')
-rw-r--r--engines/bladerunner/script/ai/desk_clerk.cpp32
1 files changed, 32 insertions, 0 deletions
diff --git a/engines/bladerunner/script/ai/desk_clerk.cpp b/engines/bladerunner/script/ai/desk_clerk.cpp
index 8b1e91fd43..d7110bc54f 100644
--- a/engines/bladerunner/script/ai/desk_clerk.cpp
+++ b/engines/bladerunner/script/ai/desk_clerk.cpp
@@ -122,6 +122,12 @@ bool AIScriptDeskClerk::GoalChanged(int currentGoalNumber, int newGoalNumber) {
case kGoalDeskClerkRecovered:
Actor_Put_In_Set(kActorDeskClerk, kSetCT09);
Actor_Set_At_XYZ(kActorDeskClerk, 282.0f, 360.52f, 743.0f, 513);
+#if BLADERUNNER_ORIGINAL_BUGS
+#else
+ Actor_Change_Animation_Mode(kActorDeskClerk, kAnimationModeIdle);
+ _animationFrame = 0;
+ _animationState = 0;
+#endif // BLADERUNNER_ORIGINAL_BUGS
break;
case kGoalDeskClerkKnockedOut:
// fall through
@@ -135,6 +141,32 @@ bool AIScriptDeskClerk::GoalChanged(int currentGoalNumber, int newGoalNumber) {
bool AIScriptDeskClerk::UpdateAnimation(int *animation, int *frame) {
+#if BLADERUNNER_ORIGINAL_BUGS
+#else
+ // Fixing a bug for when the Clerk gets stuck in animation id 668, after Act 3:
+ // - when using HDFRAMES, the clerk will briefly be in the choking animation when McCoy re-enters
+ // - when using CDFRAMES, the game would crash with a message "Unable to locate page 2214 for animation 668 frame 4!"
+ // This occurs when:
+ // The player walks out too fast from the scene where Leon is choking the clerk in Act 3.
+ // Hence, Leon's AI script's OtherAgentExitedThisScene() is triggered, Leon is gone,
+ // and DeskClerk goal is set to kGoalDeskClerkKnockedOut which puts him in kSetFreeSlotH without changing his animation id.
+ // Thus later on, when the player leaves Chinatown and returns, DeskClerk's (update()) will set his goal to kGoalDeskClerkRecovered
+ // In Act 4, the CDFRAMES#.DAT method loads a reduced number of animations for DeskClerk causing the crash when McCoy visits the Yukon lobby.
+ //
+ // The following fix will work with awry saved games too (even from the original game in theory),
+ // that have this buggy state stored.
+ // We also include the rest of the problematic states that are missing animations in Act 4
+ // (ie. all _animationState >= 6)
+ if (Global_Variable_Query(kVariableChapter) > 3
+ && _animationState >= 6
+ ) {
+ Actor_Change_Animation_Mode(kActorDeskClerk, kAnimationModeIdle);
+ *animation = 661;
+ _animationFrame = 0;
+ _animationState = 0;
+ }
+#endif // BLADERUNNER_ORIGINAL_BUGS
+
switch (_animationState) {
case 0:
if (_flag1) {