diff options
author | Travis Howell | 2007-11-25 10:04:23 +0000 |
---|---|---|
committer | Travis Howell | 2007-11-25 10:04:23 +0000 |
commit | 1266b7eb15ca9d095da8eef310726c3bf10899ad (patch) | |
tree | 1d8b1855f1abee66fa10294e6539c0888a633f36 /engines/scumm/he | |
parent | ece4ee33604d90a0e24e3cbabeaaa52745de6878 (diff) | |
download | scummvm-rg350-1266b7eb15ca9d095da8eef310726c3bf10899ad.tar.gz scummvm-rg350-1266b7eb15ca9d095da8eef310726c3bf10899ad.tar.bz2 scummvm-rg350-1266b7eb15ca9d095da8eef310726c3bf10899ad.zip |
Fix regression in Fun Shop titles, when starting activites.
svn-id: r29634
Diffstat (limited to 'engines/scumm/he')
-rw-r--r-- | engines/scumm/he/script_v72he.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/engines/scumm/he/script_v72he.cpp b/engines/scumm/he/script_v72he.cpp index e5ffa12a37..f229837414 100644 --- a/engines/scumm/he/script_v72he.cpp +++ b/engines/scumm/he/script_v72he.cpp @@ -1776,13 +1776,12 @@ void ScummEngine_v72he::o72_openFile() { } int ScummEngine_v72he::readFileToArray(int slot, int32 size) { - assert(_hInFileTable[slot]); - if (size == 0) - size = _hInFileTable[slot]->size() - _hInFileTable[slot]->pos(); - writeVar(0, 0); byte *data = defineArray(0, kByteArray, 0, 0, 0, size); - _hInFileTable[slot]->read(data, size + 1); + + if (slot != -1) { + _hInFileTable[slot]->read(data, size + 1); + } return readVar(0); } @@ -1828,8 +1827,9 @@ void ScummEngine_v72he::writeFileFromArray(int slot, int32 resID) { int32 size = (FROM_LE_32(ah->dim1end) - FROM_LE_32(ah->dim1start) + 1) * (FROM_LE_32(ah->dim2end) - FROM_LE_32(ah->dim2start) + 1); - assert(_hOutFileTable[slot]); - _hOutFileTable[slot]->write(ah->data, size); + if (slot != -1) { + _hOutFileTable[slot]->write(ah->data, size); + } } void ScummEngine_v72he::o72_writeFile() { |