From 4b2e96a99204f3a32159f414ff2d28bb52b54b03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Steffen=20Schro=CC=88der?= Date: Wed, 30 Apr 2014 05:32:29 +0200 Subject: [PATCH] fixed div by zero error --- application/plugins/CustomVotes.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/application/plugins/CustomVotes.php b/application/plugins/CustomVotes.php index df4d83e3..60b1031e 100644 --- a/application/plugins/CustomVotes.php +++ b/application/plugins/CustomVotes.php @@ -39,7 +39,7 @@ use FML\Script\Features\KeyAction; * @license http://www.gnu.org/licenses/ GNU General Public License, Version 3 */ class CustomVotesPlugin implements CommandListener, CallbackListener, ManialinkPageAnswerListener, TimerListener, Plugin { - /** + /* * Constants */ const PLUGIN_ID = 5; @@ -592,6 +592,7 @@ class CustomVotesPlugin implements CommandListener, CallbackListener, ManialinkP $timeGauge->setY(1.5); $timeGauge->setSize($width * 0.95, 6); $timeGauge->setDrawBg(false); + if (!$timeUntilExpire) $timeUntilExpire = 1; $timeGaugeRatio = (100 / $maxTime * $timeUntilExpire) / 100; $timeGauge->setRatio($timeGaugeRatio + 0.15 - $timeGaugeRatio * 0.15); $gaugeColor = ColorUtil::floatToStatusColor($timeGaugeRatio);