Merge branch 'hotfix-3-5-3'

This commit is contained in:
Enno Rehling 2015-07-12 04:48:35 +02:00
commit 12d7862c51
16 changed files with 30 additions and 68 deletions

View File

@ -33,10 +33,13 @@
<xi:include href="config:///default/adamantium.xml"/>
<equipment>
<set name="first_unit">
<item name="conquesttoken" amount="1"/>
<item name="log" amount="30"/>
<item name="stone" amount="30"/>
<item name="money" amount="4200"/>
<item name="log" amount="50"/>
<item name="stone" amount="50"/>
<item name="iron" amount="50"/>
<item name="laen" amount="10"/>
<item name="mallorn" amount="10"/>
<item name="skillpotion" amount="5"/>
<item name="money" amount="20000"/>
</set>
<set name="new_faction">
<item name="adamantium" amount="1"/>
@ -89,7 +92,7 @@
<param name="entertain.base" value="0"/>
<param name="entertain.perlevel" value="20"/>
<param name="nmr.timeout" value="5"/>
<param name="nmr.removenewbie" value="10"/>
<param name="nmr.removenewbie" value="0"/>
<param name="GiveRestriction" value="3"/>
<param name="hunger.long" value="1"/>
<param name="init_spells" value="0"/>

View File

@ -32,7 +32,6 @@
<equipment>
<set name="first_unit">
<item name="conquesttoken" amount="1"/>
<item name="log" amount="10"/>
<item name="stone" amount="10"/>
<item name="money" amount="5000"/>

View File

@ -32,7 +32,6 @@
<equipment>
<set name="first_unit">
<item name="conquesttoken" amount="1"/>
<item name="log" amount="10"/>
<item name="stone" amount="10"/>
<item name="money" amount="5000"/>

View File

@ -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

View File

@ -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

View File

@ -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)

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 not r.plane and r.terrain~="ocean" and not r.units() then
s = score(r)
if s >= limit then
table.insert(sel, r)

View File

@ -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")

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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 = [[{

View File

@ -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 = [[{

View File

@ -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;
}

View File

@ -1,3 +1,3 @@
#define VERSION_MAJOR 3
#define VERSION_MINOR 5
#define VERSION_BUILD 2
#define VERSION_BUILD 3

View File

@ -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)