avoid monsters: only seed new factions in hexes that have no units nearby.

This commit is contained in:
Enno Rehling 2015-07-04 23:42:41 +02:00
parent 9185b2af28
commit 3074a6077d
1 changed files with 2 additions and 2 deletions

View File

@ -6,7 +6,7 @@ local function score(r, res)
local x, y, rn
local peas = r:get_resource(res)
for _, rn in pairs(r.adj) do
if rn then
if rn and not rn.units() then
peas = peas + rn:get_resource(res)
end
end
@ -16,7 +16,7 @@ end
local function select(regions, limit)
local sel = {}
for r in regions do
if r.terrain~="ocean" and r.units()==nil then
if r.terrain~="ocean" and not r.units() then
s = score(r)
if s >= limit then
table.insert(sel, r)