Skip to content

Commit

Permalink
Don't skip drawing animation frames at animation start.
Browse files Browse the repository at this point in the history
Fixes cyborg legs and scavengers disappearing momentarily.

Partial revert of 123ded5.
  • Loading branch information
KJeff01 committed Jul 30, 2019
1 parent 91f7dc3 commit ad0d64f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/display3d.cpp
Expand Up @@ -366,12 +366,13 @@ bool drawShape(BASE_OBJECT *psObj, iIMDShape *strImd, int colour, PIELIGHT build
}
if (strImd->objanimframes)
{
const int elapsed = graphicsTime - psObj->timeAnimationStarted;
int elapsed = graphicsTime - psObj->timeAnimationStarted;
if (elapsed < 0)
{
return false; // Animation hasn't started yet.
elapsed = 0; // Animation hasn't started yet.
}
const int frame = (elapsed / strImd->objanimtime) % strImd->objanimframes;
ASSERT(frame < strImd->objanimframes, "Bad index %d >= %d", frame, strImd->objanimframes);
const ANIMFRAME &state = strImd->objanimdata.at(frame);
if (state.scale.x == -1.0f) // disabled frame, for implementing key frame animation
{
Expand Down

0 comments on commit ad0d64f

Please sign in to comment.