[Scummvm-git-logs] scummvm master -> 66c4c8648c74eb09586228349dd04f21f60ae9e2

athrxx noreply at scummvm.org
Wed Oct 23 19:47:55 UTC 2024


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:
66c4c8648c KYRA: (EOB) - fix true seeing spell


Commit: 66c4c8648c74eb09586228349dd04f21f60ae9e2
    https://github.com/scummvm/scummvm/commit/66c4c8648c74eb09586228349dd04f21f60ae9e2
Author: athrxx (athrxx at scummvm.org)
Date: 2024-10-23T21:47:43+02:00

Commit Message:
KYRA: (EOB) - fix true seeing spell

The spell effect was restored after loading a savegame
even when it shouldn't. The bug is actually caused by
a bug fix I made to fix an original bug (the original
never restores the true seeing effect, even when the
spell is still supposed to be active).

Changed paths:
    engines/kyra/engine/magic_eob.cpp
    engines/kyra/engine/scene_eob.cpp
    engines/kyra/gui/saveload_eob.cpp


diff --git a/engines/kyra/engine/magic_eob.cpp b/engines/kyra/engine/magic_eob.cpp
index 5349ca82234..ef4bb039caf 100644
--- a/engines/kyra/engine/magic_eob.cpp
+++ b/engines/kyra/engine/magic_eob.cpp
@@ -1149,10 +1149,12 @@ void EoBCoreEngine::spellCallback_start_stoneToFlesh() {
 
 void EoBCoreEngine::spellCallback_start_trueSeeing() {
 	_wllVmpMap[46] = 0;
+	_sceneUpdateRequired = true;
 }
 
 bool EoBCoreEngine::spellCallback_end_trueSeeing(void *) {
 	_wllVmpMap[46] = 1;
+	_sceneUpdateRequired = true;
 	return true;
 }
 
diff --git a/engines/kyra/engine/scene_eob.cpp b/engines/kyra/engine/scene_eob.cpp
index a95ec486505..ed067b5a663 100644
--- a/engines/kyra/engine/scene_eob.cpp
+++ b/engines/kyra/engine/scene_eob.cpp
@@ -466,12 +466,17 @@ void EoBCoreEngine::loadDecorations(const char *cpsFile, const char *decFile) {
 
 void EoBCoreEngine::assignWallsAndDecorations(int wallIndex, int vmpIndex, int decIndex, int specialType, int flags) {
 	_wllVmpMap[wallIndex] = vmpIndex;
-	for (int i = 0; i < 6; i++) {
-		for (int ii = 0; ii < 10; ii++) {
-			if (_characters[i].events[ii] == -57)
-				spellCallback_start_trueSeeing();
+
+	if (wallIndex == 46) {
+		// This is not part of the original code. The original will discard the true seeing spell effect when entering a new level.
+		for (int i = 0; i < 6; i++) {
+			for (int ii = 0; ii < 10; ii++) {
+				if (_characters[i].events[ii] == -57 && _characters[i].timers[ii])
+					spellCallback_start_trueSeeing();
+			}
 		}
 	}
+
 	_wllShapeMap[wallIndex] = _mappedDecorationsCount + 1;
 	_specialWallTypes[wallIndex] = specialType;
 	_wllWallFlags[wallIndex] = flags ^ 4;
diff --git a/engines/kyra/gui/saveload_eob.cpp b/engines/kyra/gui/saveload_eob.cpp
index 868d3ad4634..879323132d4 100644
--- a/engines/kyra/gui/saveload_eob.cpp
+++ b/engines/kyra/gui/saveload_eob.cpp
@@ -279,9 +279,10 @@ Common::Error EoBCoreEngine::loadGameState(int slot) {
 	_sceneUpdateRequired = true;
 	_screen->setFont(_conFont);
 
+	// This is not part of the original code. The original will not restore the true seeing spell effect when loading a game.
 	for (int i = 0; i < 6; i++) {
 		for (int ii = 0; ii < 10; ii++) {
-			if (_characters[i].events[ii] == -57)
+			if (_characters[i].events[ii] == -57 && _characters[i].timers[ii])
 				spellCallback_start_trueSeeing();
 		}
 	}




More information about the Scummvm-git-logs mailing list