diff --git a/conf/e2/config.xml b/conf/e2/config.xml
index f99176432..9b0a90851 100644
--- a/conf/e2/config.xml
+++ b/conf/e2/config.xml
@@ -33,10 +33,13 @@
-
-
-
-
+
+
+
+
+
+
+
@@ -89,7 +92,7 @@
-
+
diff --git a/conf/e3/config.xml b/conf/e3/config.xml
index 7d9a71ab2..e0669c527 100644
--- a/conf/e3/config.xml
+++ b/conf/e3/config.xml
@@ -32,7 +32,6 @@
-
diff --git a/conf/e4/config.xml b/conf/e4/config.xml
index a6439db21..1924ff2c9 100644
--- a/conf/e4/config.xml
+++ b/conf/e4/config.xml
@@ -32,7 +32,6 @@
-
diff --git a/scripts/eressea/tests/common.lua b/scripts/eressea/tests/common.lua
index 365b87195..9d3f9a306 100644
--- a/scripts/eressea/tests/common.lua
+++ b/scripts/eressea/tests/common.lua
@@ -26,7 +26,6 @@ module("tests.eressea.common", package.seeall, lunit.testcase)
function setup()
eressea.free_game()
- eressea.settings.set("nmr.removenewbie", "0")
eressea.settings.set("nmr.timeout", "0")
eressea.settings.set("NewbieImmunity", "0")
eressea.settings.set("rules.economy.food", "4")
@@ -981,7 +980,6 @@ module("tests.report", package.seeall, lunit.testcase)
function setup()
eressea.free_game()
- eressea.settings.set("nmr.removenewbie", "0")
eressea.settings.set("nmr.timeout", "0")
eressea.settings.set("rules.economy.food", "4")
end
diff --git a/scripts/eressea/tests/orders.lua b/scripts/eressea/tests/orders.lua
index af1ba8863..ea32fabdc 100644
--- a/scripts/eressea/tests/orders.lua
+++ b/scripts/eressea/tests/orders.lua
@@ -16,7 +16,6 @@ function setup()
u = _G.unit.create(f, r, 1)
u:clear_orders()
eressea.settings.set("rules.economy.food", "4")
- eressea.settings.set("nmr.removenewbie", "0")
eressea.settings.set("nmr.timeout", "0")
eressea.settings.set("NewbieImmunity", "0")
end
diff --git a/scripts/newplayer.lua b/scripts/newplayer.lua
index 239eb487b..ccd651f03 100644
--- a/scripts/newplayer.lua
+++ b/scripts/newplayer.lua
@@ -17,51 +17,12 @@ end
local function seed(r, email, race, lang)
local f = faction.create(email, race, lang)
local u = unit.create(f, r)
+ equip_unit(u, "new_faction")
+ equip_unit(u, "first_unit")
+ equip_unit(u, "first_" .. race, 7) -- disable old callbacks
u:set_skill("perception", 30)
- u:add_item("money", 20000)
- items = {
- log = 50,
- stone = 50,
- iron = 50,
- laen = 10,
- mallorn = 10,
- skillpotion = 5
- }
- for it, num in pairs(items) do
- u:add_item(it, num)
- end
- u = nil
- skills ={
- "crossbow",
- "bow",
- "building",
- "trade",
- "forestry",
- "catapult",
- "herbalism",
- "training",
- "riding",
- "armorer",
- "shipcraft",
- "melee",
- "sailing",
- "polearm",
- "espionage",
- "roadwork",
- "tactics",
- "stealth",
- "weaponsmithing",
- "cartmaking",
- "taxation",
- "stamina"
- }
- unit.create(f, r, 50):set_skill("entertainment", 15)
unit.create(f, r, 5):set_skill("mining", 30)
unit.create(f, r, 5):set_skill("quarrying", 30)
- for _, sk in ipairs(skills) do
- u = u or unit.create(f, r, 5)
- if u:set_skill(sk, 15)>0 then u=nil end
- end
return f
end
@@ -94,11 +55,17 @@ end
math.randomseed(os.time())
local newbs = {}
+local per_region = 2
+local num_seeded = 2
+local start = nil
for _, p in ipairs(players) do
- local index = math.random(#sel)
- local start = nil
- while not start or start.units() do
- start = sel[index]
+ if num_seeded == per_region then
+ while not start or start.units() do
+ local index = math.random(#sel)
+ start = sel[index]
+ end
+ create_curse(nil, r, 'holyground', 1, 52)
+ num_seeded = 0
end
local dupe = false
for f in factions() do
@@ -109,6 +76,7 @@ for _, p in ipairs(players) do
end
end
if not dupe then
+ num_seeded = num_seeded + 1
f = seed(start, p.email, p.race or "human", p.lang or "de")
print("new faction ".. tostring(f) .. " starts in ".. tostring(start))
table.insert(newbs, f)
diff --git a/scripts/populate.lua b/scripts/populate.lua
index dfd07b5dd..9ab1b5bcb 100644
--- a/scripts/populate.lua
+++ b/scripts/populate.lua
@@ -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 not r.plane and r.terrain~="ocean" and not r.units() then
s = score(r)
if s >= limit then
table.insert(sel, r)
diff --git a/scripts/tests/e2/guard.lua b/scripts/tests/e2/guard.lua
index 1afd011e9..b1c9d9c4f 100644
--- a/scripts/tests/e2/guard.lua
+++ b/scripts/tests/e2/guard.lua
@@ -4,7 +4,6 @@ module("tests.e2.guard", package.seeall, lunit.testcase)
function setup()
eressea.free_game()
- eressea.settings.set("nmr.removenewbie", "0")
eressea.settings.set("nmr.timeout", "0")
eressea.settings.set("NewbieImmunity", "0")
eressea.settings.set("rules.economy.food", "4")
diff --git a/scripts/tests/e2/movement.lua b/scripts/tests/e2/movement.lua
index ef62873d8..7e20e41ca 100644
--- a/scripts/tests/e2/movement.lua
+++ b/scripts/tests/e2/movement.lua
@@ -4,7 +4,6 @@ module("tests.e2.movement", package.seeall, lunit.testcase)
function setup()
eressea.free_game()
- eressea.settings.set("nmr.removenewbie", "0")
eressea.settings.set("nmr.timeout", "0")
eressea.settings.set("NewbieImmunity", "0")
end
diff --git a/scripts/tests/e2/shiplanding.lua b/scripts/tests/e2/shiplanding.lua
index 2d9225b8d..a46a7da37 100644
--- a/scripts/tests/e2/shiplanding.lua
+++ b/scripts/tests/e2/shiplanding.lua
@@ -4,7 +4,6 @@ module("tests.e2.shiplanding", package.seeall, lunit.testcase)
function setup()
eressea.free_game()
- eressea.settings.set("nmr.removenewbie", "0")
eressea.settings.set("nmr.timeout", "0")
eressea.settings.set("NewbieImmunity", "0")
end
diff --git a/scripts/tests/e3/spells.lua b/scripts/tests/e3/spells.lua
index 7afe96d8e..c4f0aadaf 100644
--- a/scripts/tests/e3/spells.lua
+++ b/scripts/tests/e3/spells.lua
@@ -5,7 +5,6 @@ module("tests.e3.spells", package.seeall, lunit.testcase)
function setup()
eressea.game.reset()
eressea.settings.set("magic.fumble.enable", "0")
- eressea.settings.set("nmr.removenewbie", "0")
eressea.settings.set("nmr.timeout", "0")
eressea.settings.set("rules.peasants.growth", "0")
end
diff --git a/scripts/tests/movement.lua b/scripts/tests/movement.lua
index e27831cc8..110b5b2a2 100644
--- a/scripts/tests/movement.lua
+++ b/scripts/tests/movement.lua
@@ -4,7 +4,6 @@ module("tests.movement", package.seeall, lunit.testcase)
function setup()
eressea.free_game()
- eressea.settings.set("nmr.removenewbie", "0")
eressea.settings.set("nmr.timeout", "0")
eressea.settings.set("rules.ships.storms", "0")
conf = [[{
diff --git a/scripts/tests/pool.lua b/scripts/tests/pool.lua
index 3ee3d54db..bf32eda87 100644
--- a/scripts/tests/pool.lua
+++ b/scripts/tests/pool.lua
@@ -6,7 +6,6 @@ function setup()
eressea.game.reset()
eressea.config.reset()
eressea.settings.set("rules.economy.food", "0")
- eressea.settings.set("nmr.removenewbie", "0")
eressea.settings.set("nmr.timeout", "0")
eressea.settings.set("rules.magic.playerschools", "")
conf = [[{
diff --git a/src/bindings.c b/src/bindings.c
index 169c91d0c..5fcf4ef1f 100755
--- a/src/bindings.c
+++ b/src/bindings.c
@@ -434,7 +434,9 @@ static int tolua_equipunit(lua_State * L)
{
unit *u = (unit *)tolua_tousertype(L, 1, 0);
const char *eqname = tolua_tostring(L, 2, 0);
- equip_unit(u, get_equipment(eqname));
+ int mask = (int)tolua_tonumber(L, 3, EQUIP_ALL);
+ assert(mask > 0);
+ equip_unit_mask(u, get_equipment(eqname), mask);
return 0;
}
diff --git a/src/buildno.h b/src/buildno.h
index d1f3c3fcf..813baf03b 100644
--- a/src/buildno.h
+++ b/src/buildno.h
@@ -1,3 +1,3 @@
#define VERSION_MAJOR 3
#define VERSION_MINOR 5
-#define VERSION_BUILD 2
+#define VERSION_BUILD 3
diff --git a/src/laws.c b/src/laws.c
index 13e486c2c..fe201670c 100755
--- a/src/laws.c
+++ b/src/laws.c
@@ -113,7 +113,7 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
/* - exported global symbols ----------------------------------- */
-static int RemoveNMRNewbie(void)
+static bool RemoveNMRNewbie(void)
{
static int value = -1;
static int gamecookie = -1;
@@ -122,7 +122,7 @@ static int RemoveNMRNewbie(void)
value = get_param_int(global.parameters, "nmr.removenewbie", 0);
gamecookie = global.cookie;
}
- return value;
+ return value!=0;
}
static void checkorders(void)