From e507486fc18c1b1850e23b2ae15ed0565823ac65 Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Tue, 22 Jan 2013 22:12:43 +0100 Subject: [PATCH] edit &c: Suppress news for acts of god to gods Option GODNEWS is documented to be about deities giving or taking things from players. Nevertheless, edit, give, setsector and setresource report news of deities meddling with things owned by deities other than POGO. Don't. Signed-off-by: Markus Armbruster --- src/lib/commands/edit.c | 2 +- src/lib/commands/give.c | 6 ++++-- src/lib/commands/setsect.c | 2 +- tests/actofgod/actofgod.xdump | 1 - 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/lib/commands/edit.c b/src/lib/commands/edit.c index f8d4f99c..54f80a0a 100644 --- a/src/lib/commands/edit.c +++ b/src/lib/commands/edit.c @@ -227,7 +227,7 @@ edit(void) static void benefit(natid who, int goodness) { - if (opt_GODNEWS && who && goodness) + if (opt_GODNEWS && getnatp(who)->nat_stat != STAT_GOD && goodness) nreport(player->cnum, goodness > 0 ? N_AIDS : N_HURTS, who, 1); } diff --git a/src/lib/commands/give.c b/src/lib/commands/give.c index f68affab..c1c5f2a0 100644 --- a/src/lib/commands/give.c +++ b/src/lib/commands/give.c @@ -76,13 +76,15 @@ give(void) putsect(§); if (sect.sct_own != 0 && m != n) { if (m > n) { - if (opt_GODNEWS) + if (opt_GODNEWS + && getnatp(sect.sct_own)->nat_stat != STAT_GOD) nreport(player->cnum, N_GIFT, sect.sct_own, 1); wu(0, sect.sct_own, "%s gave you %d %s in %s\n", cname(player->cnum), m - n, ip->i_name, xyas(sect.sct_x, sect.sct_y, sect.sct_own)); } else { - if (opt_GODNEWS) + if (opt_GODNEWS + && getnatp(sect.sct_own)->nat_stat != STAT_GOD) nreport(sect.sct_own, N_TAKE, player->cnum, 1); wu(0, sect.sct_own, "%s stole %d %s from %s\n", cname(player->cnum), n - m, ip->i_name, diff --git a/src/lib/commands/setsect.c b/src/lib/commands/setsect.c index 686913f2..8afafd46 100644 --- a/src/lib/commands/setsect.c +++ b/src/lib/commands/setsect.c @@ -206,7 +206,7 @@ setsector(void) static void resbenefit(natid who, int goodness) { - if (opt_GODNEWS && who && goodness) + if (opt_GODNEWS && getnatp(who)->nat_stat != STAT_GOD && goodness) nreport(player->cnum, goodness > 0 ? N_AIDS : N_HURTS, who, 1); } diff --git a/tests/actofgod/actofgod.xdump b/tests/actofgod/actofgod.xdump index 6927d1b2..6b77dc8f 100644 --- a/tests/actofgod/actofgod.xdump +++ b/tests/actofgod/actofgod.xdump @@ -361,7 +361,6 @@ actor action victim times duration time 0 42 2 38 0 0 0 42 1 39 0 0 0 44 1 19 0 0 -0 43 98 1 0 0 0 43 2 1 0 0 0 43 1 54 0 0 0 42 1 4 0 0