From f65bd3b079b3d30ee6bf60a6aaa217cf2cef573d Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Wed, 5 Oct 2016 09:28:23 +0200 Subject: [PATCH 1/9] disable logging of passwords. yikes --- process/sendreport.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/process/sendreport.sh b/process/sendreport.sh index 003026f4a..1b9af1d35 100755 --- a/process/sendreport.sh +++ b/process/sendreport.sh @@ -14,7 +14,7 @@ GAME=$1 EMAIL=$2 FACTION=$3 PASSWD=$4 -echo "$GAME $EMAIL $FACTION $PASSWD" >> /tmp/report.log +#echo "$GAME $EMAIL $FACTION $PASSWD" >> /tmp/report.log function reply() { echo $@ | mutt -s "Reportnachforderung Partei ${FACTION}" $EMAIL From 38721e20464d9d14620fd5d771e263f969901253 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Fri, 7 Oct 2016 19:33:50 +0200 Subject: [PATCH 2/9] remove all mention of centaurs from the code and configuration --- res/eressea/equipment.xml | 5 ----- res/races/zombie.xml | 2 +- src/economy.c | 35 +---------------------------------- src/kernel/faction.c | 11 +++-------- src/kernel/race.h | 1 - src/kernel/unit.c | 12 +++--------- src/kernel/xmlreader.c | 2 -- 7 files changed, 8 insertions(+), 60 deletions(-) diff --git a/res/eressea/equipment.xml b/res/eressea/equipment.xml index f35505bc0..bf7e38376 100644 --- a/res/eressea/equipment.xml +++ b/res/eressea/equipment.xml @@ -269,11 +269,6 @@ - - - - - diff --git a/res/races/zombie.xml b/res/races/zombie.xml index faecf021d..8c23aea83 100644 --- a/res/races/zombie.xml +++ b/res/races/zombie.xml @@ -3,7 +3,7 @@ recruitcost="-1" maintenance="0" weight="1000" capacity="440" speed="1.000000" hp="20" damage="1d5" unarmedattack="-2" unarmeddefense="-2" playerrace="no" walk="yes" shapeshift="no" giveperson="no" giveunit="no" - getitem="no" recruitethereal="no" equipment="yes" scarepeasants="yes" + getitem="no" equipment="yes" scarepeasants="yes" cansteal="no" unarmedguard="yes" absorbpeasants="yes" noheal="yes" undead="yes" resistpierce="yes"> diff --git a/src/economy.c b/src/economy.c index 8f6a1afa1..b17ef1cad 100644 --- a/src/economy.c +++ b/src/economy.c @@ -258,10 +258,6 @@ void add_recruits(unit * u, int number, int wanted) strlcat(equipment, "_unit", sizeof(equipment)); equip_unit(unew, get_equipment(equipment)); - if (u_race(unew)->ec_flags & ECF_REC_HORSES) { - change_level(unew, SK_RIDING, 1); - } - if (unew != u) { transfermen(unew, u, unew->number); remove_unit(&r->units, unew); @@ -278,24 +274,6 @@ static int any_recruiters(const struct race *rc, int qty) return (int)(qty * 2 * rc->recruit_multi); } -/*static int peasant_recruiters(const struct race *rc, int qty) -{ -if (rc->ec_flags & ECF_REC_ETHEREAL) -return -1; -if (rc->ec_flags & ECF_REC_HORSES) -return -1; -return (int)(qty * 2 * rc->recruit_multi); -}*/ - -static int horse_recruiters(const struct race *rc, int qty) -{ - if (rc->ec_flags & ECF_REC_ETHEREAL) - return -1; - if (rc->ec_flags & ECF_REC_HORSES) - return (int)(qty * 2.0 * rc->recruit_multi); - return -1; -} - static int do_recruiting(recruitment * recruits, int available) { recruitment *rec; @@ -407,17 +385,6 @@ static void expandrecruit(region * r, request * recruitorders) int orc_total = 0; - /* centaurs: */ - recruits = select_recruitment(&recruitorders, horse_recruiters, &orc_total); - if (recruits) { - int recruited, horses = rhorses(r) * 2; - if (orc_total < horses) - horses = orc_total; - recruited = do_recruiting(recruits, horses); - rsethorses(r, (horses - recruited) / 2); - free_recruitments(recruits); - } - /* peasant limited: */ recruits = select_recruitment(&recruitorders, any_recruiters, &orc_total); if (recruits) { @@ -539,7 +506,7 @@ static void recruit(unit * u, struct order *ord, request ** recruitorders) return; } - if (!(rc->ec_flags & ECF_REC_HORSES) && fval(r, RF_ORCIFIED)) { + if (fval(r, RF_ORCIFIED)) { if (rc != get_race(RC_ORC)) { cmistake(u, ord, 238, MSG_EVENT); return; diff --git a/src/kernel/faction.c b/src/kernel/faction.c index f97142e45..774a6aec8 100755 --- a/src/kernel/faction.c +++ b/src/kernel/faction.c @@ -386,19 +386,14 @@ void destroyfaction(faction ** fp) const race *rc = u_race(u); int m = rmoney(r); + /* Personen gehen nur an die Bauern, wenn sie auch von dort + * stammen */ if ((rc->ec_flags & ECF_REC_ETHEREAL) == 0) { int p = rpeasants(u->region); int h = rhorses(u->region); item *itm; - /* Personen gehen nur an die Bauern, wenn sie auch von dort - * stammen */ - if (rc->ec_flags & ECF_REC_HORSES) { /* Zentauren an die Pferde */ - h += u->number; - } - else { /* Orks zählen nur zur Hälfte */ - p += (int)(u->number * rc->recruit_multi); - } + p += (int)(u->number * rc->recruit_multi); for (itm = u->items; itm; itm = itm->next) { if (itm->type->flags & ITF_ANIMAL) { h += itm->number; diff --git a/src/kernel/race.h b/src/kernel/race.h index 214f2738d..dc3becabb 100644 --- a/src/kernel/race.h +++ b/src/kernel/race.h @@ -217,7 +217,6 @@ extern "C" { #define GIVEPERSON (1<<2) /* übergibt Personen */ #define GIVEUNIT (1<<3) /* Einheiten an andere Partei übergeben */ #define GETITEM (1<<4) /* nimmt Gegenstände an */ -#define ECF_REC_HORSES (1<<6) /* Rekrutiert aus Pferden */ #define ECF_REC_ETHEREAL (1<<7) /* Rekrutiert aus dem Nichts */ #define ECF_REC_UNLIMITED (1<<8) /* Rekrutiert ohne Limit */ diff --git a/src/kernel/unit.c b/src/kernel/unit.c index ab3bd294c..b499705a4 100644 --- a/src/kernel/unit.c +++ b/src/kernel/unit.c @@ -1084,15 +1084,9 @@ void transfermen(unit * u, unit * dst, int n) else if (r->land) { if ((u_race(u)->ec_flags & ECF_REC_ETHEREAL) == 0) { const race *rc = u_race(u); - if (rc->ec_flags & ECF_REC_HORSES) { /* Zentauren an die Pferde */ - int h = rhorses(r) + n; - rsethorses(r, h); - } - else { - int p = rpeasants(r); - p += (int)(n * rc->recruit_multi); - rsetpeasants(r, p); - } + int p = rpeasants(r); + p += (int)(n * rc->recruit_multi); + rsetpeasants(r, p); } } } diff --git a/src/kernel/xmlreader.c b/src/kernel/xmlreader.c index 894647f89..e022effaf 100644 --- a/src/kernel/xmlreader.c +++ b/src/kernel/xmlreader.c @@ -1730,8 +1730,6 @@ static int parse_races(xmlDocPtr doc) rc->ec_flags |= GIVEUNIT; if (xml_bvalue(node, "getitem", false)) rc->ec_flags |= GETITEM; - if (xml_bvalue(node, "recruithorses", false)) - rc->ec_flags |= ECF_REC_HORSES; if (xml_bvalue(node, "recruitethereal", false)) rc->ec_flags |= ECF_REC_ETHEREAL; if (xml_bvalue(node, "recruitunlimited", false)) From 9287d0c1b4cf2a9ac117947d19862e7cebf5c919 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Fri, 7 Oct 2016 22:06:47 +0200 Subject: [PATCH 3/9] unused function --- src/economy.c | 9 --------- 1 file changed, 9 deletions(-) diff --git a/src/economy.c b/src/economy.c index b17ef1cad..6ec5d9191 100644 --- a/src/economy.c +++ b/src/economy.c @@ -180,15 +180,6 @@ static void expandorders(region * r, request * requests) /* ------------------------------------------------------------- */ -static void change_level(unit * u, skill_t sk, int bylevel) -{ - skill *sv = unit_skill(u, sk); - assert(bylevel > 0); - if (sv == 0) - sv = add_skill(u, sk); - sk_set(sv, sv->level + bylevel); -} - typedef struct recruitment { struct recruitment *next; faction *f; From 3d191b65732c9fb81b3fdc578a0e0944f20e3a5f Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Sun, 9 Oct 2016 10:01:31 +0200 Subject: [PATCH 4/9] not likely to get fixed --- src/kernel/config.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/kernel/config.c b/src/kernel/config.c index f7eb0e303..8df618aa5 100644 --- a/src/kernel/config.c +++ b/src/kernel/config.c @@ -690,7 +690,7 @@ static const char * relpath(char *buf, size_t sz, const char *path) { static const char *g_datadir; const char *datapath(void) { - static char zText[MAX_PATH]; // FIXME: static return value + static char zText[MAX_PATH]; if (g_datadir) return g_datadir; return relpath(zText, sizeof(zText), "data"); @@ -704,7 +704,7 @@ void set_datapath(const char *path) static const char *g_reportdir; const char *reportpath(void) { - static char zText[MAX_PATH]; // FIXME: static return value + static char zText[MAX_PATH]; if (g_reportdir) return g_reportdir; return relpath(zText, sizeof(zText), "reports"); From 75422e1ba630830b19030235db824a28d0df969f Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Sun, 9 Oct 2016 10:06:51 +0200 Subject: [PATCH 5/9] fix gcc conversion warnings --- src/util/unicode.test.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/util/unicode.test.c b/src/util/unicode.test.c index f485808cb..410e8e68a 100644 --- a/src/util/unicode.test.c +++ b/src/util/unicode.test.c @@ -23,42 +23,42 @@ static void test_unicode_utf8_to_other(CuTest *tc) unsigned char ch; size_t sz; CuAssertIntEquals(tc, 0, unicode_utf8_to_cp437(&ch, utf8_str, &sz)); - CuAssertIntEquals(tc, 2, sz); + CuAssertIntEquals(tc, 2, (int)sz); CuAssertIntEquals(tc, '?', ch); CuAssertIntEquals(tc, 0, unicode_utf8_to_cp437(&ch, utf8_str+2, &sz)); - CuAssertIntEquals(tc, 2, sz); + CuAssertIntEquals(tc, 2, (int)sz); CuAssertIntEquals(tc, '?', ch); CuAssertIntEquals(tc, 0, unicode_utf8_to_cp437(&ch, utf8_str+4, &sz)); - CuAssertIntEquals(tc, 2, sz); + CuAssertIntEquals(tc, 2, (int)sz); CuAssertIntEquals(tc, '?', ch); CuAssertIntEquals(tc, 0, unicode_utf8_to_cp437(&ch, utf8_str + 6, &sz)); - CuAssertIntEquals(tc, 1, sz); + CuAssertIntEquals(tc, 1, (int)sz); CuAssertIntEquals(tc, 'l', ch); CuAssertIntEquals(tc, 0, unicode_utf8_to_cp1252(&ch, utf8_str, &sz)); - CuAssertIntEquals(tc, 2, sz); + CuAssertIntEquals(tc, 2, (int)sz); CuAssertIntEquals(tc, 216, ch); CuAssertIntEquals(tc, 0, unicode_utf8_to_cp1252(&ch, utf8_str+2, &sz)); - CuAssertIntEquals(tc, 2, sz); + CuAssertIntEquals(tc, 2, (int)sz); CuAssertIntEquals(tc, 120, ch); CuAssertIntEquals(tc, 0, unicode_utf8_to_cp1252(&ch, utf8_str + 4, &sz)); - CuAssertIntEquals(tc, 2, sz); + CuAssertIntEquals(tc, 2, (int)sz); CuAssertIntEquals(tc, 0x9d, ch); CuAssertIntEquals(tc, 0, unicode_utf8_to_cp1252(&ch, utf8_str + 6, &sz)); - CuAssertIntEquals(tc, 1, sz); + CuAssertIntEquals(tc, 1, (int)sz); CuAssertIntEquals(tc, 'l', ch); CuAssertIntEquals(tc, 0, unicode_utf8_to_ascii(&ch, utf8_str, &sz)); - CuAssertIntEquals(tc, 2, sz); + CuAssertIntEquals(tc, 2, (int)sz); CuAssertIntEquals(tc, '?', ch); CuAssertIntEquals(tc, 0, unicode_utf8_to_ascii(&ch, utf8_str + 2, &sz)); - CuAssertIntEquals(tc, 2, sz); + CuAssertIntEquals(tc, 2, (int)sz); CuAssertIntEquals(tc, '?', ch); CuAssertIntEquals(tc, 0, unicode_utf8_to_ascii(&ch, utf8_str + 4, &sz)); - CuAssertIntEquals(tc, 2, sz); + CuAssertIntEquals(tc, 2, (int)sz); CuAssertIntEquals(tc, '?', ch); CuAssertIntEquals(tc, 0, unicode_utf8_to_ascii(&ch, utf8_str + 6, &sz)); - CuAssertIntEquals(tc, 1, sz); + CuAssertIntEquals(tc, 1, (int)sz); CuAssertIntEquals(tc, 'l', ch); } From 0de30cd3768ac73cd54ce529fa23ca6835bee328 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Sun, 16 Oct 2016 11:58:42 +0200 Subject: [PATCH 6/9] remove discontinued submodules if they are checked out --- s/build | 1 + s/preview | 1 + 2 files changed, 2 insertions(+) diff --git a/s/build b/s/build index b59804626..820e330f9 100755 --- a/s/build +++ b/s/build @@ -33,6 +33,7 @@ if [ ! -d $ROOT/$BUILD ]; then exit fi +rm -rf crypto tolua git submodule update echo "build eressea" diff --git a/s/preview b/s/preview index 79411aea6..86a4f8918 100755 --- a/s/preview +++ b/s/preview @@ -22,6 +22,7 @@ exit $2 # otherwise function build() { assert_dir $SOURCE cd $SOURCE +rm -rf crypto tolua git fetch || abort "failed to update source. do you have local changes?" [ -z $1 ] || git checkout $1 git pull From 919001fae0a8c4b3fafe68b3187602fe88a2fbe2 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Sun, 16 Oct 2016 16:41:08 +0200 Subject: [PATCH 7/9] do not rmdir tolua, we need it --- s/build | 1 - 1 file changed, 1 deletion(-) diff --git a/s/build b/s/build index 820e330f9..b59804626 100755 --- a/s/build +++ b/s/build @@ -33,7 +33,6 @@ if [ ! -d $ROOT/$BUILD ]; then exit fi -rm -rf crypto tolua git submodule update echo "build eressea" From f697e06d179550c85d27c90e23d07682bce3baec Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Sun, 16 Oct 2016 18:07:45 +0200 Subject: [PATCH 8/9] do not use tolua from package --- .travis.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index df0e62c84..003fb67ad 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,7 +12,6 @@ addons: - libsqlite3-dev - libxml2-dev - valgrind - - libtolua-dev os: - linux notifications: From c7ede945b3f794fadf7534a23a136df6aed168c6 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Mon, 17 Oct 2016 19:59:06 +0200 Subject: [PATCH 9/9] use site packages on Travis CI, revert to Lua 5.1 --- .travis.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 003fb67ad..78aaf3648 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,7 +7,8 @@ script: s/travis-build addons: apt: packages: - - liblua5.2-dev + - liblua5.1-dev + - libtolua-dev - libncurses5-dev - libsqlite3-dev - libxml2-dev