From f6515c12b8f042a27763d7542656ad3be1cffb9a Mon Sep 17 00:00:00 2001 From: rubenwardy Date: Mon, 1 Aug 2016 21:04:00 +0100 Subject: [PATCH] Stop progress bars going out of bounds Fixes #21 --- api.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/api.lua b/api.lua index a1ed306..2ca187f 100644 --- a/api.lua +++ b/api.lua @@ -335,6 +335,9 @@ function awards.getFormspec(name, to, sid) label = res.label end if perc then + if perc > 1 then + perc = 1 + end formspec = formspec .. "background[0,4.80;" .. barwidth ..",0.25;awards_progress_gray.png]" formspec = formspec .. "background[0,4.80;" .. (barwidth * perc) ..",0.25;awards_progress_green.png]" if label then