diff options
Diffstat (limited to 'engines')
-rw-r--r-- | engines/fullpipe/anihandler.cpp | 4 | ||||
-rw-r--r-- | engines/fullpipe/interaction.cpp | 14 | ||||
-rw-r--r-- | engines/fullpipe/inventory.cpp | 2 | ||||
-rw-r--r-- | engines/fullpipe/scenes/scene04.cpp | 4 | ||||
-rw-r--r-- | engines/fullpipe/scenes/scene16.cpp | 2 | ||||
-rw-r--r-- | engines/fullpipe/scenes/scene27.cpp | 2 |
6 files changed, 18 insertions, 10 deletions
diff --git a/engines/fullpipe/anihandler.cpp b/engines/fullpipe/anihandler.cpp index 3c13a70a66..c8feeaeec3 100644 --- a/engines/fullpipe/anihandler.cpp +++ b/engines/fullpipe/anihandler.cpp @@ -163,14 +163,14 @@ void AniHandler::resetData(int objId) { debugC(1, kDebugPathfinding, "WWW rebuild. idx: %d, size: %d", idx, obj->_staticsList.size() * obj->_staticsList.size()); for (uint i = 0; i < obj->_staticsList.size(); i++) { - _items[idx]->statics.push_back((Statics *)obj->_staticsList[i]); + _items[idx]->statics.push_back(obj->_staticsList[i]); for (uint j = 0; j < obj->_staticsList.size(); j++) // Yes, square _items[idx]->subItems.push_back(MGMSubItem()); } for (uint i = 0; i < obj->_movements.size(); i++) { - _items[idx]->movements1.push_back((Movement *)obj->_movements[i]); + _items[idx]->movements1.push_back(obj->_movements[i]); _items[idx]->movements2.push_back(0); } 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<StaticANIObject *>(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<StaticANIObject *>(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<StaticANIObject *>(obj); + if (ani->_statics != 0 && ani->_statics->_staticsId == _staticsId1) + return true; + } } } return false; diff --git a/engines/fullpipe/inventory.cpp b/engines/fullpipe/inventory.cpp index fd8f73c0b3..5ddf26d06a 100644 --- a/engines/fullpipe/inventory.cpp +++ b/engines/fullpipe/inventory.cpp @@ -171,7 +171,7 @@ void Inventory2::removeItem2(Scene *sceneObj, int itemId, int x, int y, int prio sceneObj->addStaticANIObject(ani, 1); - ani->_statics = (Statics *)ani->_staticsList[0]; + ani->_statics = ani->_staticsList[0]; ani->setOXY(x, y); ani->_priority = priority; } diff --git a/engines/fullpipe/scenes/scene04.cpp b/engines/fullpipe/scenes/scene04.cpp index 4b5e105311..ae8e5674f7 100644 --- a/engines/fullpipe/scenes/scene04.cpp +++ b/engines/fullpipe/scenes/scene04.cpp @@ -275,7 +275,7 @@ void sceneHandler04_checkBigBallClick() { if (ball) for (uint i = 0; i < ball->_movements.size(); i++) - ((Movement *)ball->_movements[i])->_counterMax = 73; + ball->_movements[i]->_counterMax = 73; g_vars->scene04_bigBallIn = true; } @@ -1127,7 +1127,7 @@ void sceneHandler04_bigBallOut() { if (ball && ball->_flags & 4) for (uint i = 0; i < ball->_movements.size(); i++) - ((Movement *)ball->_movements[i])->_counterMax = 0; + ball->_movements[i]->_counterMax = 0; g_vars->scene04_bigBallIn = false; } diff --git a/engines/fullpipe/scenes/scene16.cpp b/engines/fullpipe/scenes/scene16.cpp index b7a63dff46..04de100318 100644 --- a/engines/fullpipe/scenes/scene16.cpp +++ b/engines/fullpipe/scenes/scene16.cpp @@ -86,7 +86,7 @@ void scene16_initScene(Scene *sc) { StaticANIObject *ani = new StaticANIObject(g_fp->accessScene(SC_COMMON)->getStaticANIObject1ById(ANI_BEARDED_CMN, -1)); ani->_movement = 0; - ani->_statics = (Statics *)ani->_staticsList[0]; + ani->_statics = ani->_staticsList[0]; sc->addStaticANIObject(ani, 1); } diff --git a/engines/fullpipe/scenes/scene27.cpp b/engines/fullpipe/scenes/scene27.cpp index 7a9a25d563..171cd6d616 100644 --- a/engines/fullpipe/scenes/scene27.cpp +++ b/engines/fullpipe/scenes/scene27.cpp @@ -235,7 +235,7 @@ void sceneHandler27_startBat(StaticANIObject *bat) { newbat->currX = newbat->powerCos + (double)g_fp->_aniMan->_ox + 42.0; newbat->currY = newbat->powerSin + (double)g_fp->_aniMan->_oy + 58.0; - bat->_statics = (Statics *)bat->_staticsList[0]; + bat->_statics = bat->_staticsList[0]; bat->setOXY((int)newbat->currX, (int)newbat->currY); bat->_flags |= 4; |