From 552f32ff973dae7438f9c4e4761b55f4d87877de Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Fri, 4 Sep 2015 14:39:44 +0200 Subject: [PATCH] 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"));