SCI: adding patch for sq4/floppy
fixing endless flight, is actually a script data bug - there is an additional property, which is not included in property count. It's used. We return 0 in that case, because we don't know about that property, resulting in nest::x never get changed and the scripts check that for advancing svn-id: r52046
This commit is contained in:
parent
f1ad1f1738
commit
4309d8c00c
1 changed files with 31 additions and 0 deletions
|
@ -392,6 +392,35 @@ const SciScriptSignature laurabow2Signatures[] = {
|
|||
{ 0, NULL, 0, 0, NULL, NULL }
|
||||
};
|
||||
|
||||
// ===========================================================================
|
||||
// script 298 of sq4/floppy has an issue. object "nest" uses another property
|
||||
// which isn't included in property count. We return 0 in that case, the game
|
||||
// adds it to nest::x. The problem is that the script also checks if x exceeds
|
||||
// we never reach that of course, so the pterodactyl-flight will go endlessly
|
||||
// we could either calculate property count differently somehow fixing this
|
||||
// but I think just patching it out is cleaner
|
||||
const byte sq4FloppySignatureEndlessFlight[] = {
|
||||
8,
|
||||
0x39, 0x04, // pushi 04 (selector x)
|
||||
0x78, // push1
|
||||
0x67, 0x08, // pTos 08 (property x)
|
||||
0x63, 0x44, // pToa 44 (invalid property)
|
||||
0x02, // add
|
||||
0
|
||||
};
|
||||
|
||||
const uint16 sq4FloppyPatchEndlessFlight[] = {
|
||||
PATCH_ADDTOOFFSET | +5,
|
||||
0x35, 0x03, // ldi 03 (which would be the content of the property)
|
||||
PATCH_END
|
||||
};
|
||||
|
||||
// script, description, magic DWORD, adjust
|
||||
const SciScriptSignature sq4Signatures[] = {
|
||||
{ 298, "Floppy: endless flight", PATCH_MAGICDWORD(0x67, 0x08, 0x63, 0x44), -3, sq4FloppySignatureEndlessFlight, sq4FloppyPatchEndlessFlight },
|
||||
{ 0, NULL, 0, 0, NULL, NULL }
|
||||
};
|
||||
|
||||
// ===========================================================================
|
||||
// It seems to scripts warp ego outside the screen somehow (or maybe kDoBresen?)
|
||||
// ego::mover is set to 0 and rm119::doit will crash in that case. This here
|
||||
|
@ -513,6 +542,8 @@ void Script::matchSignatureAndPatch(uint16 scriptNr, byte *scriptData, const uin
|
|||
signatureTable = laurabow2Signatures;
|
||||
if (g_sci->getGameId() == GID_LSL6)
|
||||
signatureTable = larry6Signatures;
|
||||
if (g_sci->getGameId() == GID_SQ4)
|
||||
signatureTable = sq4Signatures;
|
||||
if (g_sci->getGameId() == GID_SQ5)
|
||||
signatureTable = sq5Signatures;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue