Fix issue loading incorrect sprites for some actors
@@ -66,10 +66,12 @@ void MoveActors_b()
sprites[k].pos.x = screen_x;
sprites[k].pos.y = screen_y;
+ if(actors[a].sprite_type != SPRITE_STATIC) {
+
// Increase frame based on facing direction
- if (IS_NEG(actors[i].dir.y))
+ if (IS_NEG(actors[a].dir.y))
{
- fo = 1 + (actors[i].sprite_type == SPRITE_ACTOR_ANIMATED);
+ fo = 1 + (actors[a].sprite_type == SPRITE_ACTOR_ANIMATED);
if (sprites[k].frame_offset != fo)
{
sprites[k].frame_offset = fo;
@@ -77,16 +79,16 @@ void MoveActors_b()
sprites[k].rerender = TRUE;
}
}
- else if (actors[i].dir.x != 0)
+ else if (actors[a].dir.x != 0)
{
- fo = 2 + MUL_2(actors[i].sprite_type == SPRITE_ACTOR_ANIMATED);
+ fo = 2 + MUL_2(actors[a].sprite_type == SPRITE_ACTOR_ANIMATED);
if (sprites[k].frame_offset != fo)
{
sprites[k].frame_offset = fo;
sprites[k].rerender = TRUE;
}
// Facing left so flip sprite
- if (IS_NEG(actors[i].dir.x))
+ if (IS_NEG(actors[a].dir.x))
{
flip = TRUE;
if (!sprites[k].flip)
@@ -114,6 +116,7 @@ void MoveActors_b()
sprites[k].rerender = TRUE;
}
}
+ }
// Check if actor is off screen
if (((UINT16)(screen_x + 32u) >= SCREENWIDTH_PLUS_64) || ((UINT16)(screen_y + 32u) >= SCREENHEIGHT_PLUS_64))
