Skip to content

Commit

Permalink
Prevent div/0 when SP are 0 (Fix EasyRPG#653)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ghabry committed Dec 5, 2015
1 parent ab2609d commit ce53a41
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/window_battlestatus.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,11 @@ void Window_BattleStatus::DrawGaugeSystem2(int x, int y, int cur_value, int max_
gauge_x = 0;
}

int gauge_width = 25 * cur_value / max_value;
int gauge_width = 25;

if (max_value > 0) {
gauge_width = 25 * cur_value / max_value;
}

contents->StretchBlit(Rect(x, y, gauge_width, 16), *system2, Rect(48 + gauge_x, 32 + 16 * which, 16, 16), Opacity::opaque);
}
Expand Down

0 comments on commit ce53a41

Please sign in to comment.