Permalink
Browse files

STARTREK: Fix Accesses to Uninitialized Variable.

  • Loading branch information...
digitall committed Aug 9, 2018
1 parent 86c6e3f commit 8c4b448d31ca10d7cb46a238fe9882c0531f01e0
Showing with 11 additions and 10 deletions.
  1. +11 −10 engines/startrek/actors.cpp
@@ -41,23 +41,24 @@ 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;
Actor *actor = nullptr;
if (actorIndex == -1) {
// TODO
warning("loadActorAnim: actor == -1");
} else
} else {
actor = &_actorList[actorIndex];
if (actor->spriteDrawn) {
releaseAnim(actor);
drawActorToScreen(actor, animName, x, y, scale, false);
} else {
drawActorToScreen(actor, animName, x, y, scale, true);
}
if (actor->spriteDrawn) {
releaseAnim(actor);
drawActorToScreen(actor, animName, x, y, scale, false);
} else {
drawActorToScreen(actor, animName, x, y, scale, true);
}
actor->triggerActionWhenAnimFinished = false;
actor->finishedAnimActionParam = 0;
actor->triggerActionWhenAnimFinished = false;
actor->finishedAnimActionParam = 0;
}
return actorIndex;
}

0 comments on commit 8c4b448

Please sign in to comment.