diff --git a/www/res/scripts/luaToPhp.php b/www/res/scripts/luaToPhp.php index 3748599..d66cc16 100755 --- a/www/res/scripts/luaToPhp.php +++ b/www/res/scripts/luaToPhp.php @@ -31,6 +31,14 @@ function trimval(string) function trimval($str) { $str = trim($str); + + // Evaluated numbers used in fire rates like '10/10' + if (preg_match('/^((?:[0-9\.]+\w*[\*\/+-]\w*)*[0-9\.]+),?$/', $str, $matches)) + { + eval('$str = ' . $matches[1] . ';'); + return (float)$str == (int)$str ? (int)$str : (float)$str; + } + if (substr($str,0,1)=="\""){ $str = trim(substr($str,1,strlen($str)));