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

kelmer44 noreply at scummvm.org
Fri Oct 3 07:39:33 UTC 2025


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://api.github.com/repos/scummvm/scummvm .

Summary:
db34a41408 TOT: Fixes crashes on bespoke animations


Commit: db34a414087cfc2ee0ad118b1842e502cd3fc2ec
    https://github.com/scummvm/scummvm/commit/db34a414087cfc2ee0ad118b1842e502cd3fc2ec
Author: kelmer (kelmer at gmail.com)
Date: 2025-10-03T09:33:05+02:00

Commit Message:
TOT: Fixes crashes on bespoke animations

Changed paths:
    engines/tot/engine.cpp
    engines/tot/saveload.cpp


diff --git a/engines/tot/engine.cpp b/engines/tot/engine.cpp
index 9cac9bb1b62..8d59903b1f2 100644
--- a/engines/tot/engine.cpp
+++ b/engines/tot/engine.cpp
@@ -589,13 +589,14 @@ void TotEngine::animatedSequence(uint numSequence) {
 		if (g_engine->_screenLayers[13]) {
 			free(g_engine->_screenLayers[13]);
 		}
+		clearScreenLayer(13);
 		_screenLayers[13] = animptr;
 		_depthMap[13].posx = animX;
 		_depthMap[13].posy = animY;
 		assembleScreen();
 		_graphics->drawScreen(_sceneBackground);
+		_screenLayers[13] = nullptr;
 
-		clearScreenLayer(13);
 		_mainCharAnimation.depth = animIndex;
 		drawInventory();
 		for (animIndex = 32; animIndex <= secFrameCount; animIndex++) {
@@ -636,13 +637,14 @@ void TotEngine::animatedSequence(uint numSequence) {
 		if (g_engine->_screenLayers[12]) {
 			free(g_engine->_screenLayers[12]);
 		}
+		clearScreenLayer(12);
 		_screenLayers[12] = animptr;
 		_depthMap[12].posx = animX;
 		_depthMap[12].posy = animY;
 		disableSecondAnimation();
-		clearScreenLayer(12);
 		_mainCharAnimation.depth = animIndex;
 		_graphics->drawScreen(_sceneBackground);
+		_screenLayers[13] = nullptr;
 		for (animIndex = 9; animIndex <= secFrameCount; animIndex++) {
 			animationFile.read(animptr, animFrameSize);
 			emptyLoop();
diff --git a/engines/tot/saveload.cpp b/engines/tot/saveload.cpp
index 42e5aaf0a81..b1af19f78cb 100644
--- a/engines/tot/saveload.cpp
+++ b/engines/tot/saveload.cpp
@@ -564,6 +564,8 @@ void TotEngine::loadGame(SavedGame game) {
 	if (_isRedDevilCaptured == false && _currentRoomData->code == 24 && _isTrapSet == false)
 		runaroundRed();
 	_graphics->sceneTransition(false, _sceneBackground);
+
+	_saveAllowed = true;
 }
 
 Common::String drawAndSelectSaves(Common::StringArray saves, uint selectedGame) {




More information about the Scummvm-git-logs mailing list