forked from github/server
fix seeding new factions
This commit is contained in:
parent
9f7e4effc2
commit
544af40981
|
@ -76,7 +76,7 @@ end
|
||||||
|
|
||||||
function autoseed.init()
|
function autoseed.init()
|
||||||
-- local newbs = {}
|
-- local newbs = {}
|
||||||
local num_seeded = 0
|
local num_seeded = per_region
|
||||||
local start = nil
|
local start = nil
|
||||||
|
|
||||||
eressea.log.info('autoseed new players')
|
eressea.log.info('autoseed new players')
|
||||||
|
@ -94,8 +94,10 @@ function autoseed.init()
|
||||||
for _, p in ipairs(players) do
|
for _, p in ipairs(players) do
|
||||||
if num_seeded == per_region then
|
if num_seeded == per_region then
|
||||||
local index = rng_int() % #sel
|
local index = rng_int() % #sel
|
||||||
|
start = nil
|
||||||
while not start do
|
while not start do
|
||||||
start = sel[index + 1]
|
start = sel[index + 1]
|
||||||
|
sel[index+1] = nil
|
||||||
index = (index + 1) % #sel
|
index = (index + 1) % #sel
|
||||||
end
|
end
|
||||||
num_seeded = 0
|
num_seeded = 0
|
||||||
|
|
|
@ -3,7 +3,7 @@ eressea.log.debug("rules for game E2")
|
||||||
|
|
||||||
return {
|
return {
|
||||||
require('eressea'),
|
require('eressea'),
|
||||||
-- require('eressea.autoseed'),
|
require('eressea.autoseed'),
|
||||||
require('eressea.xmas'),
|
require('eressea.xmas'),
|
||||||
require('eressea.xmasitems'),
|
require('eressea.xmasitems'),
|
||||||
require('eressea.wedding'),
|
require('eressea.wedding'),
|
||||||
|
|
Loading…
Reference in New Issue