Dodge DBZ. Fixes #573.

This commit is contained in:
Olof Larsson 2014-10-03 13:22:35 +02:00
parent 73c56fee64
commit 1141dce696

View File

@ -44,7 +44,13 @@ public class CmdFactionsPlayer extends FactionsCommand
msg(Txt.titleize("Player " + mplayer.describeTo(msender)));
// INFO: Power (as progress bar)
double progressbarQuota = mplayer.getPower() / mplayer.getPowerMax();
double progressbarQuota = 0;
double playerPowerMax = mplayer.getPowerMax();
if (playerPowerMax != 0)
{
progressbarQuota = mplayer.getPower() / playerPowerMax;
}
int progressbarWidth = (int) Math.round(mplayer.getPowerMax() / mplayer.getPowerMaxUniversal() * 100);
msg("<k>Power: <v>%s", Progressbar.HEALTHBAR_CLASSIC.withQuota(progressbarQuota).withWidth(progressbarWidth).render());