From 1dcb14cfb96645b52549a32eaf1f407e331e99cc Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Fri, 22 Aug 2014 20:15:44 +0200 Subject: [PATCH 1/6] Revert "silver has a weight of 1: http://bugs.eressea.de/view.php?id=2013" This reverts commit 911992b04dd8eebab70d87993dd2b71dc8cb12f8. --- res/core/common/items.xml | 4 ---- res/items.xml | 3 +++ 2 files changed, 3 insertions(+), 4 deletions(-) create mode 100644 res/items.xml diff --git a/res/core/common/items.xml b/res/core/common/items.xml index c8910e695..d867a3126 100644 --- a/res/core/common/items.xml +++ b/res/core/common/items.xml @@ -1,10 +1,6 @@ - - - - diff --git a/res/items.xml b/res/items.xml new file mode 100644 index 000000000..e8fa7246a --- /dev/null +++ b/res/items.xml @@ -0,0 +1,3 @@ + + + From b2dc6a3a9d6058198c76f1c4a03234479f0bbbfe Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Sat, 23 Aug 2014 00:35:06 +0200 Subject: [PATCH 2/6] fix MAKE TEMP, for real this time. I hate skip_token and all that stuff. --- res/core/en/strings.xml | 2 +- s/preview | 2 +- src/laws.c | 2 ++ 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/res/core/en/strings.xml b/res/core/en/strings.xml index c58d11918..f91b1d9a7 100644 --- a/res/core/en/strings.xml +++ b/res/core/en/strings.xml @@ -1476,7 +1476,7 @@ MAKE - MAKETEMP + MAKETEMP MOVE diff --git a/s/preview b/s/preview index 9db46f7cb..a8893cc11 100755 --- a/s/preview +++ b/s/preview @@ -87,7 +87,7 @@ zip="$turn-$1.zip" zip -q -u $zip $turn-$1.?r email=$(grep "faction=$1:" reports.txt | cut -d: -f2 | sed 's/email=//') echo "sending reports to $1 / $email" -cat /dev/null | mutt -F $ERESSEA/etc/muttrc -s "Testauswertung Spiel $GAME Partei $1" -a $zip -- $email +cat /dev/null | mutt -F $ERESSEA/etc/muttrc -s "Testauswertung Spiel $game Partei $1" -a $zip -- $email } game=0 diff --git a/src/laws.c b/src/laws.c index d24ae795a..fe2ec329b 100755 --- a/src/laws.c +++ b/src/laws.c @@ -3627,6 +3627,8 @@ void new_units(void) } continue; } + init_tokens(makeord); + skip_token(); alias = getid(); token = getstrtoken(); From f1d78b4b84fd097de3777761c5573765cec92ab2 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Sun, 24 Aug 2014 00:29:19 +0200 Subject: [PATCH 3/6] fix null-pointer crash. --- src/kernel/order.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/kernel/order.c b/src/kernel/order.c index 2c1e7ee89..80991feab 100644 --- a/src/kernel/order.c +++ b/src/kernel/order.c @@ -541,7 +541,8 @@ char *write_order(const order * ord, char *buffer, size_t size) keyword_t kwd = ORD_KEYWORD(ord); if (kwd == NOKEYWORD) { const char *text = ORD_STRING(ord); - strlcpy(buffer, (const char *)text, size); + if (text) strlcpy(buffer, (const char *)text, size); + else buffer[0] = 0; } else { get_command(ord, buffer, size); From 86c2096cfa11fbe746f5e4d3c0d89f9ae17f081c Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Sun, 24 Aug 2014 00:37:03 +0200 Subject: [PATCH 4/6] use full path to preview script from cron. --- s/cron/previews.sh | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/s/cron/previews.sh b/s/cron/previews.sh index fc9f5f70b..0e9a3e0e6 100755 --- a/s/cron/previews.sh +++ b/s/cron/previews.sh @@ -1,8 +1,9 @@ #!/bin/bash - -s/preview build master -s/preview version +[ -z $ERESSEA ] && ERESSEA=$HOME/eressea +SRC=$ERESSEA/git +$SRC/s/preview build master +$SRC/s/preview version for game in 2 3 4 ; do - s/preview -g $game run && \ - s/preview -g $game send + $SRC/s/preview -g $game run && \ + $SRC/s/preview -g $game send done From 1c069da921e435cf37518c099bee7b42e8c47344 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Sun, 24 Aug 2014 12:40:00 +0200 Subject: [PATCH 5/6] segmentation fault caused by new getstrtoken semantics --- src/economy.c | 2 +- src/laws.c | 10 +++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/economy.c b/src/economy.c index 924b4f286..633e7f87e 100644 --- a/src/economy.c +++ b/src/economy.c @@ -2766,7 +2766,7 @@ static void breed_cmd(unit * u, struct order *ord) (void)init_order(ord); s = getstrtoken(); - m = atoi((const char *)s); + m = s ? atoi((const char *)s) : 0; if (m != 0) { /* first came a want-paramter */ s = getstrtoken(); diff --git a/src/laws.c b/src/laws.c index 559422642..db48dde0b 100755 --- a/src/laws.c +++ b/src/laws.c @@ -3923,10 +3923,14 @@ void defaultorders(void) order *ord = *ordp; if (getkeyword(ord) == K_DEFAULT) { char lbuf[8192]; - order *new_order; + order *new_order = 0; + const char *s; init_order(ord); - strcpy(lbuf, getstrtoken()); - new_order = parse_order(lbuf, u->faction->locale); + s = getstrtoken(); + if (s) { + strcpy(lbuf, s); + new_order = parse_order(lbuf, u->faction->locale); + } *ordp = ord->next; ord->next = NULL; free_order(ord); From a1a810a094228fc09e0163b43b6b621d298da78e Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Sun, 24 Aug 2014 12:41:39 +0200 Subject: [PATCH 6/6] segmentation fault --- src/economy.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/economy.c b/src/economy.c index 633e7f87e..940fec4f8 100644 --- a/src/economy.c +++ b/src/economy.c @@ -2775,7 +2775,7 @@ static void breed_cmd(unit * u, struct order *ord) m = INT_MAX; } - if (!s[0]) { + if (!s || !s[0]) { p = P_ANY; } else {