From 5e204083b82aebf4503077c8328f01712356306c Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Mon, 18 Sep 2017 21:43:52 +0200 Subject: [PATCH] remove noreply email, monster report. --- scripts/tests/process.lua | 11 ++++++----- src/monsters.c | 2 +- src/reports.c | 12 +++++++----- 3 files changed, 14 insertions(+), 11 deletions(-) diff --git a/scripts/tests/process.lua b/scripts/tests/process.lua index c5515be0b..296b9d5ec 100644 --- a/scripts/tests/process.lua +++ b/scripts/tests/process.lua @@ -18,8 +18,9 @@ local function file_exists(name) if f~=nil then io.close(f) return true else return false end end -local function assert_file(filename) - assert_equal(true, file_exists(filename)) +local function assert_file(filename, exists) + if exists == nil then exists = true end + assert_equal(exists, file_exists(filename)) os.remove(filename) end @@ -30,9 +31,9 @@ function test_process_turn() assert_equal(0, write_reports()) assert_equal(0, eressea.write_game("test.dat")) assert_file("data/test.dat") - assert_file("reports/" .. get_turn() .. "-ii.nr") - assert_file("reports/" .. get_turn() .. "-ii.cr") - assert_file("reports/" .. get_turn() .. "-ii.txt") + assert_file("reports/" .. get_turn() .. "-ii.nr", false) + assert_file("reports/" .. get_turn() .. "-ii.cr", false) + assert_file("reports/" .. get_turn() .. "-ii.txt", false) assert_file("reports/" .. get_turn() .. "-777.nr") assert_file("reports/" .. get_turn() .. "-777.cr") assert_file("reports/" .. get_turn() .. "-777.txt") diff --git a/src/monsters.c b/src/monsters.c index 4cd7fee29..115759d29 100644 --- a/src/monsters.c +++ b/src/monsters.c @@ -1132,7 +1132,7 @@ faction *get_or_create_monsters(void) if (!f) { const race *rc = rc_get_or_create("dragon"); const char *email = config_get("monster.email"); - f = addfaction(email ? email : "noreply@eressea.de", NULL, rc, default_locale, 0); + f = addfaction(email ? email : NULL, NULL, rc, default_locale, 0); renumber_faction(f, MONSTER_ID); faction_setname(f, "Monster"); fset(f, FFL_NPC | FFL_NOIDLEOUT); diff --git a/src/reports.c b/src/reports.c index daf1ffca4..8e91bd3da 100644 --- a/src/reports.c +++ b/src/reports.c @@ -1616,11 +1616,13 @@ int reports(void) } for (f = factions; f; f = f->next) { - int error = write_reports(f, ltime); - if (error) - retval = error; - if (mailit) - write_script(mailit, f); + if (f->email && !fval(f, FFL_NPC)) { + int error = write_reports(f, ltime); + if (error) + retval = error; + if (mailit) + write_script(mailit, f); + } } if (mailit) fclose(mailit);