File tree Expand file tree Collapse file tree 1 file changed +27
-0
lines changed
Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Original file line number Diff line number Diff line change 1212local oldPkgPath = package.path ;
1313package.path = script_path () .. " ?.lua;" .. package.path ;
1414
15+ -- Math.random Fix
16+ -- Check if fix is needed
17+ if not pcall (function ()
18+ return math.random (1 , 2 ^ 40 );
19+ end ) then
20+ local oldMathRandom = math.random ;
21+ math .random = function (a , b )
22+ if not a and b then
23+ return oldMathRandom ();
24+ end
25+ if not b then
26+ return math.random (1 , a );
27+ end
28+ if a > b then
29+ a , b = b , a ;
30+ end
31+ local diff = b - a ;
32+ assert (diff > 0 );
33+ if diff > 2 ^ 31 - 1 then
34+ return math.floor (oldMathRandom () * diff + a );
35+ else
36+ return oldMathRandom (a , b );
37+ end
38+ end
39+ end
40+
41+
1542-- Require Prometheus Submodules
1643local Pipeline = require (" prometheus.pipeline" );
1744local highlight = require (" highlightlua" );
You can’t perform that action at this time.
0 commit comments