diff options
author | Colin Snover | 2017-02-24 19:47:30 -0600 |
---|---|---|
committer | Colin Snover | 2017-04-23 13:07:25 -0500 |
commit | d0a143fa87b88649aaff39b543218925e888025c (patch) | |
tree | 4f2ecbfa99c02238ef04f16a44d674cb87d6c705 /engines/sci | |
parent | d24f5537be84ac175e85ed15415c8b3c0e00674d (diff) | |
download | scummvm-rg350-d0a143fa87b88649aaff39b543218925e888025c.tar.gz scummvm-rg350-d0a143fa87b88649aaff39b543218925e888025c.tar.bz2 scummvm-rg350-d0a143fa87b88649aaff39b543218925e888025c.zip |
SCI32: Fix locals offset in SCI3
Locals offset needs to be set even when the script has no exports.
Diffstat (limited to 'engines/sci')
-rw-r--r-- | engines/sci/engine/script.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/engines/sci/engine/script.cpp b/engines/sci/engine/script.cpp index 86f9d8d1d9..1672f69975 100644 --- a/engines/sci/engine/script.cpp +++ b/engines/sci/engine/script.cpp @@ -203,12 +203,13 @@ void Script::load(int script_nr, ResourceManager *resMan, ScriptPatcher *scriptP _numExports = _buf->getUint16LEAt(20); if (_numExports) { _exports = _buf->subspan<const uint16>(22, _numExports * sizeof(uint16)); - // SCI3 local variables always start dword-aligned - if (_numExports % 2) - _localsOffset = 22 + _numExports * 2; - else - _localsOffset = 24 + _numExports * 2; } + + // SCI3 local variables always start dword-aligned + if (_numExports % 2) + _localsOffset = 22 + _numExports * sizeof(uint16); + else + _localsOffset = 24 + _numExports * sizeof(uint16); } // WORKAROUND: Increase locals, if needed (check above) |