From 92f5718e2b5a28a6c6a0b9a221079e7fd2d42438 Mon Sep 17 00:00:00 2001 From: Colin Snover Date: Sun, 12 Nov 2017 10:13:22 -0600 Subject: FULLPIPE: Fix illegal C-style cast to incompatible type --- engines/fullpipe/interaction.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'engines') 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(obj); + if (!_staticsId1 || !(_flags & 1) || (ani && ani->_statics != 0 && ani->_statics->_staticsId == _staticsId1)) return true; } } -- cgit v1.2.3