Skip to content

Commit

Permalink
Fixed swipe related crash
Browse files Browse the repository at this point in the history
  • Loading branch information
Loobinex committed Nov 14, 2024
1 parent 697e6f1 commit 9ca9d8d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/thing_creature.c
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ void draw_swipe_graphic(void)
lbDisplay.DrawFlags = Lb_SPRITE_TRANSPAR4;
long n = (int)cctrl->inst_turn * (5 << 8) / cctrl->inst_total_turns;
long allwidth = 0;
long i = (abs(n) >> 8) -1;
long i = max(((abs(n) >> 8) -1),0);
if (i >= SWIPE_SPRITE_FRAMES)
i = SWIPE_SPRITE_FRAMES-1;
// FIXME: sprites may not be adjacent in the future, causing code below incorrect sprites and possibly crash
Expand Down

0 comments on commit 9ca9d8d

Please sign in to comment.