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-861f7616d084master
parent
75d5e135c5
commit
ad5900b2ed
|
@ -169,7 +169,7 @@ void widgSetBarSize(W_SCREEN *psScreen, UDWORD id, UDWORD iValue)
|
||||||
psBGraph->iValue = psBGraph->iRange;
|
psBGraph->iValue = psBGraph->iRange;
|
||||||
}
|
}
|
||||||
|
|
||||||
size = WBAR_SCALE * psBGraph->iValue / psBGraph->iRange;
|
size = WBAR_SCALE * psBGraph->iValue / MAX(psBGraph->iRange, 1);
|
||||||
|
|
||||||
psBGraph->majorSize = (UWORD)size;
|
psBGraph->majorSize = (UWORD)size;
|
||||||
}
|
}
|
||||||
|
@ -191,7 +191,7 @@ void widgSetMinorBarSize(W_SCREEN *psScreen, UDWORD id, UDWORD iValue )
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
size = WBAR_SCALE * iValue / psBGraph->iRange;
|
size = WBAR_SCALE * iValue / MAX(psBGraph->iRange, 1);
|
||||||
if (size > WBAR_SCALE)
|
if (size > WBAR_SCALE)
|
||||||
{
|
{
|
||||||
size = WBAR_SCALE;
|
size = WBAR_SCALE;
|
||||||
|
|
Loading…
Reference in New Issue