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

athrxx noreply at scummvm.org
Thu Apr 21 22:09:14 UTC 2022


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:
b5571cc089 SCUMM: fix another regression from 2adc35e


Commit: b5571cc089ba63f653c33c26bafbee46323ad818
    https://github.com/scummvm/scummvm/commit/b5571cc089ba63f653c33c26bafbee46323ad818
Author: athrxx (athrxx at scummvm.org)
Date: 2022-04-22T00:08:50+02:00

Commit Message:
SCUMM: fix another regression from 2adc35e

The direction parameter used in setDirection can be > 360, so it may not be passed to newDirToOldDir() directly.
Also, fix the converting routine for old saves.

Changed paths:
    engines/scumm/actor.cpp


diff --git a/engines/scumm/actor.cpp b/engines/scumm/actor.cpp
index 0759dc31cd6..5c780f873fd 100644
--- a/engines/scumm/actor.cpp
+++ b/engines/scumm/actor.cpp
@@ -1522,7 +1522,7 @@ void Actor::setDirection(int direction) {
 			// the original interpreters do). I haven't found any signs that v7/8 require it, though.
 			// I haven't checked HE, but since it uses the same AKOS costumes as v7/8 I leave that
 			// as it is...	
-			if ((vald & 3) == newDirToOldDir(direction)) {
+			if ((vald & 3) == newDirToOldDir(_facing)) {
 				// v1/2 skip the frame only if everything is equal...
 				if (_vm->_game.version > 2 || (vald >> 2) == _frame)
 					continue;
@@ -3820,8 +3820,10 @@ void Actor::saveLoadWithSerializer(Common::Serializer &s) {
 		// For older saves, we can't reconstruct the frame's direction if it is different from the actor
 		// direction, this is the best we can do. However, it seems to be relevant only for very rare
 		// edge cases, anyway...
-		for (int i = 0; i < 16; ++i)
-			_cost.frame[i] = (_cost.frame[i] << 2) | newDirToOldDir(_facing);
+		for (int i = 0; i < 16; ++i) {
+			if (_cost.frame[i] != 0xffff)
+				_cost.frame[i] = (_cost.frame[i] << 2) | newDirToOldDir(_facing);
+		}
 	}
 }
 




More information about the Scummvm-git-logs mailing list