From a00fdf9316f3c1e0779c05a70aefccfc5170d3f7 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Mon, 31 Aug 2015 11:12:45 +0200 Subject: [PATCH 1/7] fix hitpoints for summoned wolves --- src/spells/combatspells.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/spells/combatspells.c b/src/spells/combatspells.c index ed71e17bf..d5f38032e 100644 --- a/src/spells/combatspells.c +++ b/src/spells/combatspells.c @@ -904,6 +904,7 @@ int sp_wolfhowl(castorder * co) u = fi->unit; set_level(u, SK_WEAPONLESS, skills); set_level(u, SK_STAMINA, skills); + u->hp = u->number * unit_max_hp(u); } return level; } From f0a9cc8233aae9f0d24f2c94900937aa6fc24123 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Mon, 31 Aug 2015 11:19:16 +0200 Subject: [PATCH 2/7] added a lua module that marks factions as cursed --- scripts/eressea/cursed.lua | 28 ++++++++++++++++++++++++++++ scripts/eressea/e2/init.lua | 3 ++- 2 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 scripts/eressea/cursed.lua diff --git a/scripts/eressea/cursed.lua b/scripts/eressea/cursed.lua new file mode 100644 index 000000000..795d7aeb3 --- /dev/null +++ b/scripts/eressea/cursed.lua @@ -0,0 +1,28 @@ +require 'bit32' + +local function curse(file) + for line in file:lines() do + f = get_faction(line) + if not f then + print("no such faction: " .. line) + elseif bit32.band(16, f.flags)==0 then + print("cursing " .. tostring(f)) + f.flags = f.flags + 16 + else + print("already cursed: " .. tostring(f)) + end + end +end + +local cursed = {} + +function cursed.init() + print("curses!") + local f = io.open("cursed.txt", "r") + if f then + print("found cursed.txt") + curse(f) + end +end + +return cursed diff --git a/scripts/eressea/e2/init.lua b/scripts/eressea/e2/init.lua index 581836147..2bdc79b64 100644 --- a/scripts/eressea/e2/init.lua +++ b/scripts/eressea/e2/init.lua @@ -14,5 +14,6 @@ return { require('eressea.astral'), require('eressea.locales'), require('eressea.jsreport'), - require('eressea.ents') + require('eressea.ents'), + require('eressea.cursed') } From 6d592a44605f690b332472d00051f9c3d485765c Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Mon, 31 Aug 2015 12:53:24 +0200 Subject: [PATCH 3/7] drifting ships do not take damage (forum debate), version update --- conf/e2/config.xml | 1 + src/buildno.h | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/conf/e2/config.xml b/conf/e2/config.xml index b97abcea4..00b0a0d86 100644 --- a/conf/e2/config.xml +++ b/conf/e2/config.xml @@ -100,6 +100,7 @@ + diff --git a/src/buildno.h b/src/buildno.h index ba737a69f..05e1213de 100644 --- a/src/buildno.h +++ b/src/buildno.h @@ -1,3 +1,3 @@ #define VERSION_MAJOR 3 #define VERSION_MINOR 6 -#define VERSION_BUILD 1 +#define VERSION_BUILD 2 From 552f32ff973dae7438f9c4e4761b55f4d87877de Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Fri, 4 Sep 2015 14:39:44 +0200 Subject: [PATCH 4/7] bugfix https://bugs.eressea.de/view.php?id=2133 era in the CR is wrong for E2 build in the CR should be a string (did not have quotes) Lua < 5.2 does not have bit32 (and Windows build uses 5.1) --- conf/e2/config.xml | 1 + scripts/eressea/cursed.lua | 9 ++++++--- src/creport.c | 2 +- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/conf/e2/config.xml b/conf/e2/config.xml index 00b0a0d86..2001d5f62 100644 --- a/conf/e2/config.xml +++ b/conf/e2/config.xml @@ -115,6 +115,7 @@ + diff --git a/scripts/eressea/cursed.lua b/scripts/eressea/cursed.lua index 795d7aeb3..2501a941b 100644 --- a/scripts/eressea/cursed.lua +++ b/scripts/eressea/cursed.lua @@ -1,11 +1,15 @@ -require 'bit32' +local function bitset(flags, bit) + -- TODO: use bit32 when we no longer have to consider lua 5.1 compatibility + local x = flags % (bit*2) + return x >= bit +end local function curse(file) for line in file:lines() do f = get_faction(line) if not f then print("no such faction: " .. line) - elseif bit32.band(16, f.flags)==0 then + elseif bitset(f.flags, 16) then print("cursing " .. tostring(f)) f.flags = f.flags + 16 else @@ -17,7 +21,6 @@ end local cursed = {} function cursed.init() - print("curses!") local f = io.open("cursed.txt", "r") if f then print("found cursed.txt") diff --git a/src/creport.c b/src/creport.c index 55e2bccce..85dde4a93 100644 --- a/src/creport.c +++ b/src/creport.c @@ -1540,7 +1540,7 @@ report_computer(const char *filename, report_context * ctx, const char *charset) fprintf(F, "%d;Basis\n", 36); fprintf(F, "%d;Runde\n", turn); fprintf(F, "%d;Zeitalter\n", era); - fprintf(F, "%d.%d.%d;Build\n", VERSION_MAJOR, VERSION_MINOR, VERSION_BUILD); + fprintf(F, "\"%d.%d.%d\";Build\n", VERSION_MAJOR, VERSION_MINOR, VERSION_BUILD); if (mailto != NULL) { fprintf(F, "\"%s\";mailto\n", mailto); fprintf(F, "\"%s\";mailcmd\n", LOC(f->locale, "mailcmd")); From 9b75f369a1609a9d7fb3f992e82edc5e3476e913 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Fri, 4 Sep 2015 14:44:04 +0200 Subject: [PATCH 5/7] Temporarily disable osx build on Travis --- .travis.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index dd3f469ec..be630407e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,7 +14,6 @@ addons: - valgrind os: - linux -- osx notifications: slack: secure: F89aXLWaE125PaJIlETv12jT4EfH6wLXJmGCPZzrN3OcLn2ahDWqjwuzR7lOEDf2nAISmeMPyDZMhEHXLNHAE5qP6lg9yliYQw5hzGmDK9m1xUq/pPEne/b2Y7K3my1mkRZ6n3asbHgSmBWAfCIk1JN8R5Rv+rmbLuWLc+zofts= From 9394431ddde3b31281f11925c8b9758506900fbc Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Sat, 5 Sep 2015 19:54:57 +0200 Subject: [PATCH 6/7] disable travis build on osx --- .travis.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 013487ff3..210d1c35b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,7 +8,6 @@ before_install: - sudo apt-get install -qq libtolua-dev liblua5.1-dev libncurses5-dev libsqlite3-dev libxml2-dev os: - linux - - osx notifications: slack: secure: F89aXLWaE125PaJIlETv12jT4EfH6wLXJmGCPZzrN3OcLn2ahDWqjwuzR7lOEDf2nAISmeMPyDZMhEHXLNHAE5qP6lg9yliYQw5hzGmDK9m1xUq/pPEne/b2Y7K3my1mkRZ6n3asbHgSmBWAfCIk1JN8R5Rv+rmbLuWLc+zofts= From b33babd31668e0320f16ac0aa96bbb0dca2e8393 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Sun, 6 Sep 2015 13:20:37 +0200 Subject: [PATCH 7/7] fix cursed factions (broke it during bit32 changes) --- scripts/eressea/cursed.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/eressea/cursed.lua b/scripts/eressea/cursed.lua index 2501a941b..ecf4db9de 100644 --- a/scripts/eressea/cursed.lua +++ b/scripts/eressea/cursed.lua @@ -9,7 +9,7 @@ local function curse(file) f = get_faction(line) if not f then print("no such faction: " .. line) - elseif bitset(f.flags, 16) then + elseif not bitset(f.flags, 16) then print("cursing " .. tostring(f)) f.flags = f.flags + 16 else