Prevents a division by 0 error reported in the forums.

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5842 4a71c877-e1ca-e34f-864e-861f7616d084
master
Buginator 2008-08-21 03:16:31 +00:00
parent cf7c584399
commit 81395a05b3
1 changed files with 10 additions and 0 deletions

View File

@ -269,6 +269,11 @@ void intUpdateProgressBar(WIDGET *psWidget, W_CONTEXT *psContext)
{
BuildPoints = Range;
}
// prevent a division by 0 error
if (Range == 0)
{
Range = 1;
}
BarGraph->majorSize = (UWORD)PERNUM(WBAR_SCALE,BuildPoints,Range);
BarGraph->style &= ~WIDG_HIDDEN;
}
@ -321,6 +326,11 @@ void intUpdateProgressBar(WIDGET *psWidget, W_CONTEXT *psContext)
{
BuildPoints = Range;
}
// prevent a division by 0 error
if (Range == 0)
{
Range = 1;
}
BarGraph->majorSize = (UWORD)PERNUM(WBAR_SCALE,BuildPoints,Range);
BarGraph->style &= ~WIDG_HIDDEN;
} else {