forked from github/server
math.mod is deprecated
This commit is contained in:
parent
64658bd260
commit
ba328d913e
|
@ -13,14 +13,14 @@ end
|
|||
local function freeze(r, chance)
|
||||
for i, rn in ipairs(r.adj) do
|
||||
-- each region has a chance to freeze
|
||||
if rn.terrain=="ocean" and (chance>=100 or math.mod(rng_int(), 100)<chance) then
|
||||
if rn.terrain=="ocean" and (chance>=100 or math.fmod(rng_int(), 100)<chance) then
|
||||
rn.terrain = "packice"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
local function thaw(r, chance)
|
||||
if chance>=100 or math.mod(rng_int(), 100)<chance then
|
||||
if chance>=100 or math.fmod(rng_int(), 100)<chance then
|
||||
r.terrain = "ocean"
|
||||
for s in r.ships do
|
||||
s.coast = nil
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
-- use only once to hand out some items to existing factions
|
||||
function adamant_gifts()
|
||||
for f in factions() do
|
||||
local i = math.mod(test.rng_int(), 2)
|
||||
local i = math.fmod(test.rng_int(), 2)
|
||||
if i==0 then
|
||||
f:add_item("adamantium", 1)
|
||||
f:add_item("adamantiumplate", 1)
|
||||
|
|
|
@ -39,7 +39,7 @@ function wyrm()
|
|||
local r
|
||||
for index, r in pairs(map) do
|
||||
if r~=grave then
|
||||
if (math.mod(r.x,2)==math.mod(get_turn(),2)) then
|
||||
if (math.fmod(r.x,2)==math.fmod(get_turn(),2)) then
|
||||
r:add_notice("Eine Botschaft von Igjarjuk, Herr der Wyrme: 'Die Zeit des Wartens ist beinahe vorrüber. Euer Fürst kehrt aus dem Grabe zurück.'")
|
||||
else
|
||||
r:add_notice("Eine Botschaft von Gwaewar, Herr der Greife: 'Das Ende naht. Igjarjuk ist aus seinem Grab auferstanden. Eilt, noch ist die Welt zu retten!'")
|
||||
|
|
|
@ -34,7 +34,7 @@ local function get_target(param)
|
|||
if ntargets==0 then
|
||||
return nil
|
||||
end
|
||||
local rn = math.mod(rng_int(), ntargets)
|
||||
local rn = math.fmod(rng_int(), ntargets)
|
||||
return targets[rn]
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue