]> git.pond.sub.org Git - empserver/commitdiff
edit &c: Suppress news for acts of god to gods
authorMarkus Armbruster <armbru@pond.sub.org>
Tue, 22 Jan 2013 21:12:43 +0000 (22:12 +0100)
committerMarkus Armbruster <armbru@pond.sub.org>
Thu, 6 Jun 2013 17:55:00 +0000 (19:55 +0200)
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 <armbru@pond.sub.org>
src/lib/commands/edit.c
src/lib/commands/give.c
src/lib/commands/setsect.c
tests/actofgod/actofgod.xdump

index f8d4f99ca8e2242eb63db336cdc619f4ad2e8d78..54f80a0af0e46aeadc5c03e38ca4fda3ce7eae0a 100644 (file)
@@ -227,7 +227,7 @@ edit(void)
 static void
 benefit(natid who, int goodness)
 {
 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);
 }
 
        nreport(player->cnum, goodness > 0 ? N_AIDS : N_HURTS, who, 1);
 }
 
index f68affab47c161103ed2adaac3e306c7169a939a..c1c5f2a0a61001e732189150ae957d7a025ca7e6 100644 (file)
@@ -76,13 +76,15 @@ give(void)
        putsect(&sect);
        if (sect.sct_own != 0 && m != n) {
            if (m > n) {
        putsect(&sect);
        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 {
                    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,
                    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,
index 686913f256c29f5618a644d30af55918df387436..8afafd46465032515f27cd3b12e470dec044bf08 100644 (file)
@@ -206,7 +206,7 @@ setsector(void)
 static void
 resbenefit(natid who, int goodness)
 {
 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);
 }
 
        nreport(player->cnum, goodness > 0 ? N_AIDS : N_HURTS, who, 1);
 }
 
index 6927d1b25b2a83e621420e0926e2989b6c983c44..6b77dc8f911b9ee63721a1a086513bcd2b32afeb 100644 (file)
@@ -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 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
 0 43 2 1 0 0
 0 43 1 54 0 0
 0 42 1 4 0 0