aboutsummaryrefslogtreecommitdiff
path: root/engines/fullpipe/interaction.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/fullpipe/interaction.cpp')
-rw-r--r--engines/fullpipe/interaction.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/engines/fullpipe/interaction.cpp b/engines/fullpipe/interaction.cpp
index 8a959260ab..f13d826879 100644
--- a/engines/fullpipe/interaction.cpp
+++ b/engines/fullpipe/interaction.cpp
@@ -518,12 +518,11 @@ bool Interaction::canInteract(GameObject *obj1, GameObject *obj2, int invId) {
}
bool Interaction::isOverlapping(StaticANIObject *subj, GameObject *obj) {
- StaticANIObject *ani = (StaticANIObject *)obj;
-
if (abs(_xOffs + obj->_ox - subj->_ox) <= 1
&& abs(obj->_oy + _yOffs - subj->_oy) <= 1) {
if (!_staticsId2 || (subj->_statics != 0 && subj->_statics->_staticsId == _staticsId2)) {
- if (!_staticsId1 || !(_flags & 1) || (ani->_statics != 0 && ani->_statics->_staticsId == _staticsId1))
+ StaticANIObject *ani = dynamic_cast<StaticANIObject *>(obj);
+ if (!_staticsId1 || !(_flags & 1) || (ani && ani->_statics != 0 && ani->_statics->_staticsId == _staticsId1))
return true;
}
}