Merge pull request #363 from ennorehling/master

fix scripting bug in new autoseed module
This commit is contained in:
Enno Rehling 2015-11-04 09:02:09 +01:00
commit 0414890923
1 changed files with 16 additions and 16 deletions

View File

@ -78,23 +78,23 @@ function autoseed.init()
local sel
eressea.log.info(#players .. ' new players')
sel = select_regions(regions(), peasants, trees)
end
for _, p in ipairs(players) do
if num_seeded == per_region then
while not start or start.units() do
local index = 1 + (rng_int() % #sel)
start = sel[index]
for _, p in ipairs(players) do
if num_seeded == per_region then
while not start or start.units() do
local index = 1 + (rng_int() % #sel)
start = sel[index]
end
num_seeded = 0
end
local dupe = get_faction_by_email(p.email)
if dupe then
eressea.log.warning("seed: duplicate email " .. p.email .. " already used by faction " .. tostring(f))
else
local f = seed(start, p.email, p.race or "human", p.lang or "de")
num_seeded = num_seeded + 1
print("new faction ".. tostring(f) .. " starts in ".. tostring(start))
-- table.insert(newbs, f)
end
num_seeded = 0
end
local dupe = get_faction_by_email(p.email)
if dupe then
eressea.log.warning("seed: duplicate email " .. p.email .. " already used by faction " .. tostring(f))
else
local f = seed(start, p.email, p.race or "human", p.lang or "de")
num_seeded = num_seeded + 1
print("new faction ".. tostring(f) .. " starts in ".. tostring(start))
-- table.insert(newbs, f)
end
end
end