diff options
author | Filippos Karapetis | 2016-02-19 02:43:55 +0200 |
---|---|---|
committer | Filippos Karapetis | 2016-02-19 02:43:55 +0200 |
commit | 9aac0bdaaa03dfba9ef2a631fd80fca11cb1ac41 (patch) | |
tree | 084aeda7c21c6fad66faa50ab58018766c951e80 /engines/sci | |
parent | b9430d7c727d7c1edb865e962b8ea862e6a84ab0 (diff) | |
download | scummvm-rg350-9aac0bdaaa03dfba9ef2a631fd80fca11cb1ac41.tar.gz scummvm-rg350-9aac0bdaaa03dfba9ef2a631fd80fca11cb1ac41.tar.bz2 scummvm-rg350-9aac0bdaaa03dfba9ef2a631fd80fca11cb1ac41.zip |
SCI: Compare offsets in the Plane comparison operator
Fixes a crash in the first scene of Torin's Passage
Diffstat (limited to 'engines/sci')
-rw-r--r-- | engines/sci/graphics/plane32.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/engines/sci/graphics/plane32.h b/engines/sci/graphics/plane32.h index a68700a031..8eec417b43 100644 --- a/engines/sci/graphics/plane32.h +++ b/engines/sci/graphics/plane32.h @@ -258,7 +258,13 @@ public: // other future conflicts with script-generated planes then we need // to come up with a solution that works, similar to // reg_t::pointerComparisonWithInteger used by SCI16. - return _priority < other._priority || (_priority == other._priority && _priority > -1 && _object < other._object); + // + // For now, we check the object offsets, as this will likely work + // like in the original SCI engine, without comparing objects. + // However, this whole comparison is quite ugly, and if it still + // fails, we should try to change it to something equivalent, to avoid + // adding loads of workarounds just for this + return _priority < other._priority || (_priority == other._priority && _priority > -1 && _object.getOffset() < other._object.getOffset()); } /** |