From 316af5a400c66a47f3cbc53bb6d55b494c2ceef8 Mon Sep 17 00:00:00 2001 From: Major Cooke Date: Tue, 18 Apr 2017 23:12:21 -0500 Subject: [PATCH] - fixed: DrawBar never checked maxval for dividing by 0. --- wadsrc/static/zscript/statusbar/statusbar.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wadsrc/static/zscript/statusbar/statusbar.txt b/wadsrc/static/zscript/statusbar/statusbar.txt index 789e3cd8d..62bfa7fb3 100644 --- a/wadsrc/static/zscript/statusbar/statusbar.txt +++ b/wadsrc/static/zscript/statusbar/statusbar.txt @@ -978,7 +978,7 @@ class BaseStatusBar native ui Vector2 texsize = TexMan.GetScaledSize(ontex); [position, flags] = AdjustPosition(position, flags, texsize.X, texsize.Y); - double value = clamp(curval / maxval, 0, 1); + double value = (maxval != 0) ? clamp(curval / maxval, 0, 1) : 0; if(border != 0) value = 1. - value; //invert since the new drawing method requires drawing the bg on the fg.