diff options
-rw-r--r-- | engines/startrek/actors.cpp | 4 | ||||
-rw-r--r-- | engines/startrek/awaymission.cpp | 6 | ||||
-rw-r--r-- | engines/startrek/events.cpp | 2 |
3 files changed, 5 insertions, 7 deletions
diff --git a/engines/startrek/actors.cpp b/engines/startrek/actors.cpp index aef7a7baff..239818e1ee 100644 --- a/engines/startrek/actors.cpp +++ b/engines/startrek/actors.cpp @@ -41,13 +41,11 @@ void StarTrekEngine::initActors() { int StarTrekEngine::loadActorAnim(int actorIndex, const Common::String &animName, int16 x, int16 y, Fixed8 scale) { debugC(6, kDebugGraphics, "Load animation '%s' on actor %d", animName.c_str(), actorIndex); - Actor *actor = nullptr; - if (actorIndex == -1) { // TODO warning("loadActorAnim: actor == -1"); } else { - actor = &_actorList[actorIndex]; + Actor *actor = &_actorList[actorIndex]; if (actor->spriteDrawn) { releaseAnim(actor); diff --git a/engines/startrek/awaymission.cpp b/engines/startrek/awaymission.cpp index 9b4d936f05..9edf121083 100644 --- a/engines/startrek/awaymission.cpp +++ b/engines/startrek/awaymission.cpp @@ -179,7 +179,6 @@ void StarTrekEngine::initAwayCrewPositions(int warpEntryIndex) { void StarTrekEngine::handleAwayMissionEvents() { TrekEvent event; - int clickedObject = -1; if (popNextEvent(&event)) { switch (event.type) { @@ -244,13 +243,13 @@ void StarTrekEngine::handleAwayMissionEvents() { case Common::KEYCODE_i: if (_awayMission.activeAction == ACTION_USE) { hideInventoryIcons(); - clickedObject = showInventoryMenu(50, 50, true); + int clickedObject = showInventoryMenu(50, 50, true); if (clickedObject == -1) clickedObject = -2; awayMissionUseObject(clickedObject); } else if (_awayMission.activeAction == ACTION_LOOK) { hideInventoryIcons(); - clickedObject = showInventoryMenu(50, 50, true); + int clickedObject = showInventoryMenu(50, 50, true); if (clickedObject == -1) clickedObject = -2; awayMissionGetLookOrTalk(clickedObject); @@ -410,6 +409,7 @@ void StarTrekEngine::awayMissionUseObject(int16 clickedObject) { tryWalkToHotspot = true; else if (_awayMission.activeObject == OBJECT_MCCOY && _room->actionHasCode(ACTION_USE, OBJECT_IMEDKIT, _awayMission.passiveObject, 0)) tryWalkToHotspot = true; + // CHECKME: Identical to the previous check, thus never used else if (_awayMission.activeObject == OBJECT_MCCOY && _room->actionHasCode(ACTION_USE, OBJECT_IMEDKIT, _awayMission.passiveObject, 0)) tryWalkToHotspot = true; else if (_awayMission.activeObject == OBJECT_SPOCK && _room->actionHasCode(ACTION_USE, OBJECT_ISTRICOR, _awayMission.passiveObject, 0)) diff --git a/engines/startrek/events.cpp b/engines/startrek/events.cpp index a8b2552227..8e7d2c1884 100644 --- a/engines/startrek/events.cpp +++ b/engines/startrek/events.cpp @@ -161,7 +161,7 @@ bool StarTrekEngine::popNextEvent(TrekEvent *e, bool poll) { void StarTrekEngine::addEventToQueue(const TrekEvent &e) { if (e.type == TREKEVENT_MOUSEMOVE && _mouseMoveEventInQueue) { // Only allow one mouse move event at once - for (Common::List<TrekEvent>::iterator i = _eventQueue.begin(); i != _eventQueue.end(); i++) { + for (Common::List<TrekEvent>::iterator i = _eventQueue.begin(); i != _eventQueue.end(); ++i) { if (i->type == TREKEVENT_MOUSEMOVE) { *i = e; return; |