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-861f7616d084master
parent
cf7c584399
commit
81395a05b3
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue