From f6ba5b6a53b6e56a1c786669ac5d0496baa97f75 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Sun, 11 Jun 2017 17:06:13 +0200 Subject: [PATCH] BUG 2333 NMR-Anzahl im WB falsch https://bugs.eressea.de/view.php?id=2333 --- scripts/run-turn.lua | 6 ++++-- src/kernel/config.c | 1 + src/kernel/save.c | 5 +---- src/summary.c | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/scripts/run-turn.lua b/scripts/run-turn.lua index 9118ed8ee..3ec87c045 100644 --- a/scripts/run-turn.lua +++ b/scripts/run-turn.lua @@ -142,8 +142,9 @@ function process(rules, orders) return -1 end - callbacks(rules, 'init') + turn_begin() init_summary() + callbacks(rules, 'init') -- run the turn: if eressea.read_orders(orders) ~= 0 then @@ -157,12 +158,13 @@ function process(rules, orders) return -1 end - process_orders() callbacks(rules, 'update') + turn_process() write_files(config.locales) dbupdate() + turn_end() file = '' .. get_turn() .. '.dat' if eressea.write_game(file)~=0 then eressea.log.error("could not write game") diff --git a/src/kernel/config.c b/src/kernel/config.c index 37765914b..566b9fc88 100644 --- a/src/kernel/config.c +++ b/src/kernel/config.c @@ -869,6 +869,7 @@ const char * game_mailcmd(void) } *r = '\0'; log_warning("game.mailcmd configuration is not set, using %s from game.name", result); + config_set("game.mailcmd", result); return result; } return param; diff --git a/src/kernel/save.c b/src/kernel/save.c index 39f2a129f..b28482e97 100644 --- a/src/kernel/save.c +++ b/src/kernel/save.c @@ -241,10 +241,7 @@ static faction *factionorders(void) } /* Die Partei hat sich zumindest gemeldet, so dass sie noch * nicht als untätig gilt */ - - /* TODO: +1 ist ein Workaround, weil cturn erst in process_orders - * incrementiert wird. */ - f->lastorders = turn + 1; + f->lastorders = turn; } else { diff --git a/src/summary.c b/src/summary.c index 90cab98c0..916124815 100644 --- a/src/summary.c +++ b/src/summary.c @@ -92,7 +92,7 @@ int update_nmrs(void) ++newplayers; } else if (!fval(f, FFL_NOIDLEOUT|FFL_CURSED)) { - int nmr = turn - f->lastorders + 1; + int nmr = turn - f->lastorders; if (timeout>0) { if (nmr < 0 || nmr > timeout) { log_error("faction %s has %d NMR", itoa36(f->no), nmr);