[Scummvm-git-logs] scummvm master -> 901aec72bd1ce14ed31fc8cd6024a50d2949d12e
athrxx
noreply at scummvm.org
Wed Apr 17 20:47:25 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:
901aec72bd KYRA: (LOL) - fix bug no. 15074
Commit: 901aec72bd1ce14ed31fc8cd6024a50d2949d12e
https://github.com/scummvm/scummvm/commit/901aec72bd1ce14ed31fc8cd6024a50d2949d12e
Author: athrxx (athrxx at scummvm.org)
Date: 2024-04-17T22:46:25+02:00
Commit Message:
KYRA: (LOL) - fix bug no. 15074
(Game Crash after getting Paulson's key in Mines l.4)
It its possible to still have Lora in the party when meeting
Paulson which the game is not prepared for. There is no
mechanism to handle a new party member when there
are already 3 members present. The game simply expects
that the scripts handle this flawlessly by removing a certain
member before adding a new one. I have now added a
workaround to remove Lora from the group if she is still
there when Paulson is supposed to join.
Changed paths:
engines/kyra/engine/lol.cpp
engines/kyra/engine/lol.h
engines/kyra/script/script_lol.cpp
diff --git a/engines/kyra/engine/lol.cpp b/engines/kyra/engine/lol.cpp
index e7b2641b148..dea6b326c9b 100644
--- a/engines/kyra/engine/lol.cpp
+++ b/engines/kyra/engine/lol.cpp
@@ -79,6 +79,10 @@ LoLEngine::LoLEngine(OSystem *system, const GameFlags &flags) : KyraRpgEngine(sy
_langIntern = 1;
break;
+ case Common::ZH_TWN:
+ _langIntern = 3;
+ break;
+
default:
warning("unsupported language, switching back to English");
break;
@@ -225,6 +229,8 @@ LoLEngine::LoLEngine(OSystem *system, const GameFlags &flags) : KyraRpgEngine(sy
_floatingCursorsEnabled = _autoSaveNamesEnabled = false;
_smoothScrollingEnabled = true;
+ _displayLoraPaulsonWorkaroundMsg = false;
+
memset(&_itemScript, 0, sizeof(_itemScript));
}
@@ -1036,6 +1042,21 @@ void LoLEngine::update() {
snd_updateCharacterSpeech();
fadeText();
+ if (_displayLoraPaulsonWorkaroundMsg) {
+ // Special WORKAROUND message for the Lora Paulson bug (see LoLEngine::addCharacter())
+ static const char *msg[] = {
+ "Lora has left the party. Her items are on the floor.",
+ "Lora a quitte le groupe. Ses objets sont par terre.",
+ "Lora hat die Gruppe verlassen. Ihre Sachen sind auf dem Boden.",
+ "Lora has left the party. Her items are on the floor.", // TODO: Translate to Japanese
+ "Lora ha abandonado el grupo. Sus artículos estan en el suelo.",
+ "Lora has left the party. Her items are on the floor." // TODO: Translate to Traditional Chinese
+ };
+
+ _displayLoraPaulsonWorkaroundMsg = false;
+ _txt->printMessage(4, "%s", msg[CLIP<int>(_langIntern ? _langIntern + 2 : _lang, 0, ARRAYSIZE(msg) - 1)]);
+ }
+
updateInput();
_screen->updateScreen();
}
@@ -1161,8 +1182,24 @@ bool LoLEngine::addCharacter(int id) {
};
int numChars = countActiveCharacters();
- if (numChars == 4)
- return false;
+ if (numChars >= 3) {
+ if (_characters[2].id == 4 && id == 6 && _currentLevel == 16 && _currentBlock == 0x225) {
+ // WORKAROUND: There can be a situation which the original game does not expect and does not handle
+ // when trying to pick up Paulson in the Urbish Mine and having more than 2 characters in the party.
+ // It it possible to exploit a bug to keep Lora in the party, although the game would expect her to
+ // leave earlier in the game. This will just crash the game, or when fixed, will not allow to pick
+ // up Paulson. So, we just boot her here as gracefully as possible (which is not very graceful).
+ const uint16 *itm = _characters[2].items;
+ for (int i = 0; i < 11; ++i) {
+ if (itm[i])
+ placeMoveLevelItem(itm[i], _currentLevel, _currentBlock, 0, 0, 0);
+ }
+ _displayLoraPaulsonWorkaroundMsg = true;
+ numChars = 2;
+ } else {
+ return false;
+ }
+ }
int i = 0;
for (; i < _charDefaultsSize; i++) {
diff --git a/engines/kyra/engine/lol.h b/engines/kyra/engine/lol.h
index 46e10c3f06d..0e9b5d1403b 100644
--- a/engines/kyra/engine/lol.h
+++ b/engines/kyra/engine/lol.h
@@ -1166,6 +1166,8 @@ private:
uint8 *_pageBuffer1;
uint8 *_pageBuffer2;
+ bool _displayLoraPaulsonWorkaroundMsg;
+
static const KyraRpgGUISettings _guiSettings;
static const KyraRpgGUISettings _guiSettingsZH;
diff --git a/engines/kyra/script/script_lol.cpp b/engines/kyra/script/script_lol.cpp
index a5e975b7b78..30c59a77861 100644
--- a/engines/kyra/script/script_lol.cpp
+++ b/engines/kyra/script/script_lol.cpp
@@ -1069,7 +1069,7 @@ int LoLEngine::olol_playAttackSound(EMCState *script) {
}
int LoLEngine::olol_addRemoveCharacter(EMCState *script) {
- debugC(3, kDebugLevelScriptFuncs, "LoLEngine::olol_addRemoveCharacter(%p) (%d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2));
+ debugC(3, kDebugLevelScriptFuncs, "LoLEngine::olol_addRemoveCharacter(%p) (%d)", (const void *)script, stackPos(0));
int16 id = stackPos(0);
if (id < 0) {
@@ -1078,7 +1078,7 @@ int LoLEngine::olol_addRemoveCharacter(EMCState *script) {
if (!(_characters[i].flags & 1) || _characters[i].id != id)
continue;
- _characters[i].flags &= 0xFFFE;
+ _characters[i].flags &= ~1;
calcCharPortraitXpos();
if (_selectedCharacter == i)
@@ -1096,6 +1096,7 @@ int LoLEngine::olol_addRemoveCharacter(EMCState *script) {
return 1;
}
+
int LoLEngine::olol_giveItem(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "LoLEngine::olol_giveItem(%p) (%d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2));
int item = makeItem(stackPos(0), stackPos(1), stackPos(2));
More information about the Scummvm-git-logs
mailing list