[Scummvm-git-logs] scummvm master -> 862ad3b3b5095ac7042406f05eef0fd49b7d7333

athrxx noreply at scummvm.org
Fri Oct 13 13:58:50 UTC 2023


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:
862ad3b3b5 SCUMM: (v7/8) - fix minor walk code regression


Commit: 862ad3b3b5095ac7042406f05eef0fd49b7d7333
    https://github.com/scummvm/scummvm/commit/862ad3b3b5095ac7042406f05eef0fd49b7d7333
Author: athrxx (athrxx at scummvm.org)
Date: 2023-10-13T15:57:31+02:00

Commit Message:
SCUMM: (v7/8) - fix minor walk code regression

(found in COMI, reported on discord)

Changed paths:
    engines/scumm/actor.cpp


diff --git a/engines/scumm/actor.cpp b/engines/scumm/actor.cpp
index 52513636e91..61db234ae62 100644
--- a/engines/scumm/actor.cpp
+++ b/engines/scumm/actor.cpp
@@ -544,7 +544,7 @@ int Actor::calcMovementFactor(const Common::Point& next) {
 	_walkdata.deltaYFactor = deltaYFactor;
 
 	if (_vm->_game.version >= 7)
-		_targetFacing = normalizeAngle(_vm->_costumeLoader->hasManyDirections(_costume), (int)(atan2((double)deltaXFactor, (double)-deltaYFactor) * 180 / M_PI));
+		_targetFacing = ((int)(atan2((double)deltaXFactor, (double)-deltaYFactor) * 180 / M_PI) + 360) % 360;
 	else
 		_targetFacing = (ABS(diffY) * 3 > ABS(diffX)) ? (deltaYFactor > 0 ? 180 : 0) : (deltaXFactor > 0 ? 90 : 270);
 
@@ -600,7 +600,7 @@ int Actor::actorWalkStep() {
 	int nextFacing = (_vm->_game.version < 7) ? updateActorDirection(true) : _targetFacing;
 	if (!(_moving & MF_IN_LEG) || _facing != nextFacing) {
 		if (_walkFrame != _frame || _facing != nextFacing) {
-			startWalkAnim(1, nextFacing);
+			startWalkAnim(_vm->_game.version >= 7 && (_moving & MF_IN_LEG) ? 2 : 1, nextFacing);
 		}
 		_moving |= MF_IN_LEG;
 	}




More information about the Scummvm-git-logs mailing list