Fix crash in design screen if we draw a weapon component that is really really big.

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2194 4a71c877-e1ca-e34f-864e-861f7616d084
master
Per Inge Mathisen 2007-07-25 22:17:04 +00:00
parent 75d5e135c5
commit ad5900b2ed
1 changed files with 2 additions and 2 deletions

View File

@ -169,7 +169,7 @@ void widgSetBarSize(W_SCREEN *psScreen, UDWORD id, UDWORD iValue)
psBGraph->iValue = psBGraph->iRange;
}
size = WBAR_SCALE * psBGraph->iValue / psBGraph->iRange;
size = WBAR_SCALE * psBGraph->iValue / MAX(psBGraph->iRange, 1);
psBGraph->majorSize = (UWORD)size;
}
@ -191,7 +191,7 @@ void widgSetMinorBarSize(W_SCREEN *psScreen, UDWORD id, UDWORD iValue )
return;
}
size = WBAR_SCALE * iValue / psBGraph->iRange;
size = WBAR_SCALE * iValue / MAX(psBGraph->iRange, 1);
if (size > WBAR_SCALE)
{
size = WBAR_SCALE;