Fix division by zero on progress bars with max=0

directional-lights
Sven Eberhardt 2016-10-01 10:26:25 -04:00
parent d35fc728bf
commit b317afbadc
1 changed files with 1 additions and 1 deletions

View File

@ -44,7 +44,7 @@ func SetBarColor(c, b)
func Update()
{
var p = (current * 100) / maximum;
var p = (current * 100) / Max(1, maximum);
var w = (width * 1000) / 110;
var l = (width * p * 10) / 110;
SetObjDrawTransform((width * 1000) / 110, 0, 0, 0, (height * 1000) / 19, 0, 0);