|
@ -39,13 +39,9 @@ local function randomseed2(seed) |
|
|
X2 = v + 1 |
|
|
X2 = v + 1 |
|
|
end |
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
local R = math.random |
|
|
local RS = math.randomseed |
|
|
local RS = math.randomseed |
|
|
math.randomseed = function(seed) |
|
|
|
|
|
RANDOM_CALLS_COUNT = 0 |
|
|
|
|
|
RS(seed) |
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
local R = math.random |
|
|
|
|
|
local function random(n, m) |
|
|
local function random(n, m) |
|
|
RANDOM_CALLS_COUNT = RANDOM_CALLS_COUNT + 1 |
|
|
RANDOM_CALLS_COUNT = RANDOM_CALLS_COUNT + 1 |
|
|
|
|
|
|
|
@ -63,6 +59,12 @@ local function random(n, m) |
|
|
return r |
|
|
return r |
|
|
end |
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
math.randomseed = function(seed) |
|
|
|
|
|
RANDOM_CALLS_COUNT = 0 |
|
|
|
|
|
R = am.rand(seed) |
|
|
|
|
|
math.random = random |
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
-- whenever we refer to math.random, actually use the function 'random' above |
|
|
-- whenever we refer to math.random, actually use the function 'random' above |
|
|
math.random = random |
|
|
math.random = random |
|
|
|
|
|
|
|
|