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

dreammaster dreammaster at scummvm.org
Fri May 14 02:51:03 UTC 2021


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:
f95499dbbb AGS: Fixed ChangeRoom for <= 2.72 games moving character too early


Commit: f95499dbbb183f16bc58d5c557f5d4d193f7077d
    https://github.com/scummvm/scummvm/commit/f95499dbbb183f16bc58d5c557f5d4d193f7077d
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2021-05-13T19:50:59-07:00

Commit Message:
AGS: Fixed ChangeRoom for <= 2.72 games moving character too early

Changed paths:
    engines/ags/engine/ac/character.cpp


diff --git a/engines/ags/engine/ac/character.cpp b/engines/ags/engine/ac/character.cpp
index 6811df1b77..2c36d9f145 100644
--- a/engines/ags/engine/ac/character.cpp
+++ b/engines/ags/engine/ac/character.cpp
@@ -226,19 +226,17 @@ void Character_ChangeRoomSetLoop(CharacterInfo *chaa, int room, int x, int y, in
 	}
 
 	if ((x != SCR_NO_VALUE) && (y != SCR_NO_VALUE)) {
+		// We cannot set character position right away,
+		// because room switch will occur only after the script end,
+		// and character position may be still changing meanwhile.
 		_G(new_room_pos) = 0;
 
-		if (_G(loaded_game_file_version) <= kGameVersion_272) {
-			// Set position immediately on 2.x.
-			chaa->x = x;
-			chaa->y = y;
-		} else {
-			// don't check X or Y bounds, so that they can do a
-			// walk-in animation if they want
-			_G(new_room_x) = x;
-			_G(new_room_y) = y;
-			if (direction != SCR_NO_VALUE) _G(new_room_loop) = direction;
-		}
+		// Don't check X or Y bounds, so that they can do a
+		// walk-in animation if they want
+		_G(new_room_x) = x;
+		_G(new_room_y) = y;
+		if (direction != SCR_NO_VALUE)
+			_G(new_room_loop) = direction;
 	}
 
 	NewRoom(room);




More information about the Scummvm-git-logs mailing list