diff --git a/conf/e2/config.xml b/conf/e2/config.xml index 0ff1d67ee..b97abcea4 100644 --- a/conf/e2/config.xml +++ b/conf/e2/config.xml @@ -33,10 +33,17 @@ - - - - + + + + + + + + + + + @@ -53,7 +60,6 @@ - @@ -94,11 +100,7 @@ - - - - diff --git a/conf/e3/config.xml b/conf/e3/config.xml index 958db184f..31d9b31a7 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 eb881901c..c8d6b21a3 100644 --- a/conf/e4/config.xml +++ b/conf/e4/config.xml @@ -32,7 +32,6 @@ - diff --git a/s/preview b/s/preview index c89f4c3ca..157628f42 100755 --- a/s/preview +++ b/s/preview @@ -1,12 +1,5 @@ #!/bin/bash -MACHINE=`uname -m` -[ -z "$CC" ] && [ ! -z `which clang` ] && CC="clang" -[ -z "$CC" ] && [ ! -z `which gcc` ] && CC="gcc" -[ -z "$CC" ] && [ ! -z `which tcc` ] && CC="tcc" -[ -z "$CC" ] && [ ! -z `which cc` ] && CC="cc" -BUILD="build-$MACHINE-$CC-Debug" - function usage() { cat <] [-g ] [-f ] command [args] @@ -89,7 +82,7 @@ rm -rf reports mkdir -p reports SUPP="$SOURCE/share/ubuntu-12_04.supp" -SERVER="$SOURCE/$BUILD/eressea/eressea" +SERVER="$SOURCE/Debug/eressea/eressea" VALGRIND=$(which valgrind) if [ ! -z $VALGRIND ]; then SERVER="$VALGRIND --suppressions=$SUPP --error-exitcode=1 --leak-check=no $SERVER" diff --git a/scripts/newplayer.lua b/scripts/newplayer.lua index 9d64f585b..45df076d6 100644 --- a/scripts/newplayer.lua +++ b/scripts/newplayer.lua @@ -9,7 +9,9 @@ local function read_players() local str = input:read("*line") if str==nil then break end local email, race, lang = str:match("([^ ]*) ([^ ]*) ([^ ]*)") - table.insert(players, { race = race, lang = lang, email = email }) + if string.char(string.byte(email, 1))~='#' then + table.insert(players, { race = race, lang = lang, email = email }) + end end return players end @@ -17,21 +19,12 @@ end local function seed(r, email, race, lang) local f = faction.create(email, race, lang) local u = unit.create(f, r) - 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 + equip_unit(u, "new_faction") + equip_unit(u, "first_unit") + equip_unit(u, "first_" .. race, 7) -- disable old callbacks unit.create(f, r, 5):set_skill("mining", 30) unit.create(f, r, 5):set_skill("quarrying", 30) + f:set_origin(r) return f end @@ -50,12 +43,13 @@ local function dump_selection(sel) end players = read_players() -local limit = 30000 +local peasants = 20000 +local trees = 1000 local turn = get_turn() local sel if #players > 0 then eressea.read_game(("%d.dat"):format(turn)) - sel = p.select(regions(), limit) + sel = p.select(regions(), peasants, trees) if #sel > 0 then local best = dump_selection(sel) print("finest region, " .. best.score .. " points: " .. tostring(best.r)) diff --git a/scripts/populate.lua b/scripts/populate.lua index 5df2ad92f..fd01f2af1 100644 --- a/scripts/populate.lua +++ b/scripts/populate.lua @@ -13,12 +13,11 @@ local function score(r, res) return peas end -local function select(regions, limit) +local function select(regions, peasants, trees) local sel = {} for r in regions do - if r.terrain~="ocean" and not r.units() then - s = score(r) - if s >= limit then + if not r.plane and r.terrain~="ocean" and not r.units() then + if score(r, "peasant") >= peasants and score(r, "tree") >= trees then table.insert(sel, r) end end diff --git a/src/bindings.c b/src/bindings.c index 6e61dc186..3e842ba92 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; }