From 8e8932f38d61789c76fd03a4a01e3cb74d3dc52d Mon Sep 17 00:00:00 2001 From: Colin Snover Date: Tue, 14 Nov 2017 12:56:01 -0600 Subject: FULLPIPE: Remove unnecessary and illegal C-style casts --- engines/fullpipe/interaction.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'engines/fullpipe/interaction.cpp') diff --git a/engines/fullpipe/interaction.cpp b/engines/fullpipe/interaction.cpp index f13d826879..4e3a3a3d86 100644 --- a/engines/fullpipe/interaction.cpp +++ b/engines/fullpipe/interaction.cpp @@ -172,7 +172,10 @@ bool InteractionController::handleInteraction(StaticANIObject *subj, GameObject return false; if (!inter->_objectId2) { - StaticANIObject *ani = (StaticANIObject *)obj; + if (obj->_objtype != kObjTypeStaticANIObject) + return false; + + StaticANIObject *ani = static_cast(obj); if (!ani->isIdle()) return false; @@ -521,9 +524,14 @@ bool Interaction::isOverlapping(StaticANIObject *subj, GameObject *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)) { - StaticANIObject *ani = dynamic_cast(obj); - if (!_staticsId1 || !(_flags & 1) || (ani && ani->_statics != 0 && ani->_statics->_staticsId == _staticsId1)) + if (!_staticsId1 || !(_flags & 1)) return true; + + if (obj->_objtype == kObjTypeStaticANIObject) { + const StaticANIObject *ani = static_cast(obj); + if (ani->_statics != 0 && ani->_statics->_staticsId == _staticsId1) + return true; + } } } return false; -- cgit v1.2.3