Skip to content
Permalink
Browse files

BLADERUNNER: Fix for McCoy resuming combat resting pose

In the original McCoy becomes "frozen" in a single targeting frame if shot at an enemy
  • Loading branch information...
antoniou79 committed May 22, 2019
1 parent 479a1d1 commit 17da1f23525f671bc51ff6991fb7c731c3b70c7a
Showing with 11 additions and 3 deletions.
  1. +3 −3 engines/bladerunner/mouse.cpp
  2. +8 −0 engines/bladerunner/script/ai/mccoy.cpp
@@ -387,7 +387,7 @@ void Mouse::tick(int x, int y) {
int actorId = Actor::findTargetUnderMouse(_vm, x, y);
int itemId = _vm->_items->findTargetUnderMouse(x, y);

bool isObject = isTarget && sceneObjectId >= kSceneObjectOffsetObjects && sceneObjectId <= 293;
bool isObject = isTarget && sceneObjectId >= kSceneObjectOffsetObjects && sceneObjectId <= (95 + kSceneObjectOffsetObjects);

if (!_vm->_playerActor->isMoving()) {
if (actorId >= 0) {
@@ -412,7 +412,7 @@ void Mouse::tick(int x, int y) {
break;
}

if (!_vm->_playerActor->isMoving() && animationMode != kAnimationModeCombatAim && animationMode != 22 && animationMode != 49) {
if (!_vm->_playerActor->isMoving() && animationMode != kAnimationModeCombatAim && animationMode != kAnimationModeCombatHit && animationMode != kAnimationModeCombatDie) {
_vm->_playerActor->changeAnimationMode(kAnimationModeCombatAim, false);
}
} else {
@@ -427,7 +427,7 @@ void Mouse::tick(int x, int y) {
cursorId = 10;
break;
}
if (!_vm->_playerActor->isMoving() && animationMode != kAnimationModeCombatIdle && animationMode != 22 && animationMode != 49) {
if (!_vm->_playerActor->isMoving() && animationMode != kAnimationModeCombatIdle && animationMode != kAnimationModeCombatHit && animationMode != kAnimationModeCombatDie) {
_vm->_playerActor->changeAnimationMode(kAnimationModeCombatIdle, false);
}
}
@@ -767,6 +767,8 @@ bool AIScriptMcCoy::UpdateAnimation(int *animation, int *frame) {
break;

case 17:
// this is just frame 0 always, McCoy doesn't animated shoot in this animation State
// animation state 21 is for the full shooting animation
*animation = kModelAnimationMcCoyWithGunShooting;
_animationFrame = 0;
// weird, but thats in game code
@@ -809,6 +811,12 @@ bool AIScriptMcCoy::UpdateAnimation(int *animation, int *frame) {
_animationState = 17;
_animationFrame = 0;
*animation = kModelAnimationMcCoyWithGunShooting;
#if BLADERUNNER_ORIGINAL_BUGS
#else
// Resume combat idle position even when shot at a target -- if it's no longer a target (dead or moved)
ChangeAnimationMode(kAnimationModeCombatIdle);
#endif // BLADERUNNER_ORIGINAL_BUGS

if (Actor_Query_Goal_Number(kActorMcCoy) == kGoalMcCoyNR11Shoot) {
_animationFrame = 0;
_animationState = 21;

0 comments on commit 17da1f2

Please sign in to comment.
You can’t perform that action at this time.