SCI: Fix bug #12808 - restore the behavior of seek() in SCI

With the latest changes to savegame streams, seeking to a location
past the end of a file results in an assert. Restore the previous
behavior, where the file pointer seeks to the maximum available
file location.
This commit is contained in:
Filippos Karapetis 2021-08-16 20:19:58 +03:00
parent 994ac18c52
commit 4241d3fae4

View File

@ -773,6 +773,7 @@ reg_t kFileIOSeek(EngineState *s, int argc, reg_t *argv) {
FileHandle *f = getFileFromHandle(s, handle);
if (f && f->_in) {
offset = MIN<int16>(offset, f->_in->size());
const bool success = f->_in->seek(offset, whence);
if (getSciVersion() >= SCI_VERSION_2) {
if (success) {