aboutsummaryrefslogtreecommitdiff
path: root/engines/sci
diff options
context:
space:
mode:
authorFilippos Karapetis2016-02-19 02:43:55 +0200
committerFilippos Karapetis2016-02-19 02:43:55 +0200
commit9aac0bdaaa03dfba9ef2a631fd80fca11cb1ac41 (patch)
tree084aeda7c21c6fad66faa50ab58018766c951e80 /engines/sci
parentb9430d7c727d7c1edb865e962b8ea862e6a84ab0 (diff)
downloadscummvm-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.h8
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());
}
/**