diff options
| author | Colin Snover | 2016-09-24 11:06:20 -0500 |
|---|---|---|
| committer | Colin Snover | 2016-09-29 19:39:16 -0500 |
| commit | 7011ee8f507da0598b46e19004169e5d60d7d5a6 (patch) | |
| tree | 0f69ed6290b2a89529ce36afb481aac31c3ca6dd /engines | |
| parent | cb66bfead0bbd0ff2ba3eebc8202f1bedc7777b3 (diff) | |
| download | scummvm-rg350-7011ee8f507da0598b46e19004169e5d60d7d5a6.tar.gz scummvm-rg350-7011ee8f507da0598b46e19004169e5d60d7d5a6.tar.bz2 scummvm-rg350-7011ee8f507da0598b46e19004169e5d60d7d5a6.zip | |
SCI32: Fix Torin inventory crash caused by wrong array type
Diffstat (limited to 'engines')
| -rw-r--r-- | engines/sci/engine/script_patches.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/engines/sci/engine/script_patches.cpp b/engines/sci/engine/script_patches.cpp index 280e26ae03..60ade4545f 100644 --- a/engines/sci/engine/script_patches.cpp +++ b/engines/sci/engine/script_patches.cpp @@ -4551,8 +4551,30 @@ static const SciScriptPatcherEntry sq6Signatures[] = { #pragma mark - #pragma mark Torin's Passage +// Torin initializes the inventory with an int16 array, which happens to work +// in SSCI because object references are int16s, but in ScummVM object +// references are reg_ts, so this array needs to be created as an IDArray +// instead +static const uint16 torinInventItemSlotsSignature[] = { + 0x38, SIG_UINT16(0x8d), // pushi $8d (new) + 0x78, // push1 + SIG_MAGICDWORD, + 0x67, 0x2e, // pTos $2e (invSlotsTot) + 0x51, 0x0b, // class IntArray + SIG_END +}; + +static const uint16 torinInventItemSlotsPatch[] = { + PATCH_ADDTOOFFSET(+3), // pushi $8d (new) + PATCH_ADDTOOFFSET(+1), // push1 + PATCH_ADDTOOFFSET(+2), // pTos $2e (invSlotsTot) + 0x51, 0x0c, // class IDArray + PATCH_END +}; + // script, description, signature patch static const SciScriptPatcherEntry torinSignatures[] = { + { true, 64895, "fix inventory array type", 1, torinInventItemSlotsSignature, torinInventItemSlotsPatch }, { true, 64990, "increase number of save games", 1, sci2NumSavesSignature1, sci2NumSavesPatch1 }, { true, 64990, "increase number of save games", 1, sci2NumSavesSignature2, sci2NumSavesPatch2 }, SCI_SIGNATUREENTRY_TERMINATOR |
