]> git.pond.sub.org Git - empserver/commitdiff
edit &c: Suppress bulletins for acts of god to himself
authorMarkus Armbruster <armbru@pond.sub.org>
Tue, 22 Jan 2013 21:05:06 +0000 (22:05 +0100)
committerMarkus Armbruster <armbru@pond.sub.org>
Thu, 6 Jun 2013 17:55:00 +0000 (19:55 +0200)
Deities get bulletins when they use edit, give, setsector and
setresource on stuff they own.  Except for POGO, who can't own
anything.

The bulletins are annoying; suppress them.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
src/lib/commands/edit.c
src/lib/commands/give.c
src/lib/commands/setsect.c

index 54f80a0af0e46aeadc5c03e38ca4fda3ce7eae0a..6353c4c21bfde1eaf573aedd768d20797dd18f7c 100644 (file)
@@ -236,7 +236,7 @@ noise(struct sctstr *sptr, char *name, int old, int new)
 {
     pr("%s of %s changed from %d to %d\n",
        name, xyas(sptr->sct_x, sptr->sct_y, player->cnum), old, new);
-    if (sptr->sct_own && new != old)
+    if (sptr->sct_own && sptr->sct_own != player->cnum && new != old)
        wu(0, sptr->sct_own,
           "%s in %s was changed from %d to %d by an act of %s\n",
           name, xyas(sptr->sct_x, sptr->sct_y, sptr->sct_own),
@@ -431,7 +431,7 @@ edit_sect(struct sctstr *sect, char *key, int arg, char *p)
           prnatid(sect->sct_own), prnatid(arg));
        if (arg == sect->sct_own)
            break;
-       if (sect->sct_own) {
+       if (sect->sct_own && sect->sct_own != player->cnum) {
            wu(0, sect->sct_own,
               "Sector %s taken from you by an act of %s!\n",
               xyas(sect->sct_x, sect->sct_y, sect->sct_own),
@@ -439,7 +439,7 @@ edit_sect(struct sctstr *sect, char *key, int arg, char *p)
        }
        benefit(sect->sct_own, -1);
        sect->sct_own = arg;
-       if (arg) {
+       if (arg && arg != player->cnum) {
            wu(0, arg,
               "Sector %s given to you by an act of %s!\n",
               xyas(sect->sct_x, sect->sct_y, arg),
@@ -643,9 +643,10 @@ edit_nat(struct natstr *np, char *key, int arg, char *p)
           np->nat_reserve, arg);
        if (arg == np->nat_reserve)
            break;
-       wu(0, nat,
-          "Military reserves changed from %d to %d by an act of %s\n",
-          np->nat_reserve, arg, cname(player->cnum));
+       if (nat != player->cnum)
+           wu(0, nat,
+              "Military reserves changed from %d to %d by an act of %s\n",
+              np->nat_reserve, arg, cname(player->cnum));
        np->nat_reserve = arg;
        break;
     case 'c':
@@ -679,8 +680,9 @@ edit_nat(struct natstr *np, char *key, int arg, char *p)
        pr("Money changed from %d to %d\n", np->nat_money, arg);
        if (arg == np->nat_money)
            break;
-       wu(0, nat, "Money changed from %d to %d by an act of %s\n",
-          np->nat_money, arg, cname(player->cnum));
+       if (nat != player->cnum)
+           wu(0, nat, "Money changed from %d to %d by an act of %s\n",
+              np->nat_money, arg, cname(player->cnum));
        np->nat_money = arg;
        break;
     case 'T':
@@ -746,10 +748,10 @@ edit_ship(struct shpstr *ship, char *key, int arg, char *p)
            return RET_SYN;
        if (arg == ship->shp_own)
            break;
-       if (ship->shp_own)
+       if (ship->shp_own && ship->shp_own != player->cnum)
            wu(0, ship->shp_own, "%s taken from you by an act of %s!\n",
               prship(ship), cname(player->cnum));
-       if (arg)
+       if (arg && arg != player->cnum)
            wu(0, arg, "%s given to you by an act of %s!\n",
               prship(ship), cname(player->cnum));
        ship->shp_own = arg;
@@ -829,10 +831,10 @@ edit_land(struct lndstr *land, char *key, int arg, char *p)
            return RET_SYN;
        if (arg == land->lnd_own)
            break;
-       if (land->lnd_own)
+       if (land->lnd_own && land->lnd_own != player->cnum)
            wu(0, land->lnd_own, "%s taken from you by an act of %s!\n",
               prland(land), cname(player->cnum));
-       if (arg)
+       if (arg && arg != player->cnum)
            wu(0, arg, "%s given to you by an act of %s!\n",
               prland(land), cname(player->cnum));
        land->lnd_own = arg;
@@ -929,10 +931,10 @@ edit_plane(struct plnstr *plane, char *key, int arg, char *p)
            return RET_SYN;
        if (arg == plane->pln_own)
            break;
-       if (plane->pln_own)
+       if (plane->pln_own && plane->pln_own != player->cnum)
            wu(0, plane->pln_own, "%s taken from you by an act of %s!\n",
               prplane(plane), cname(player->cnum));
-       if (arg)
+       if (arg && arg != player->cnum)
            wu(0, arg, "%s given to you by an act of %s!\n",
               prplane(plane), cname(player->cnum));
        plane->pln_own = arg;
index c1c5f2a0a61001e732189150ae957d7a025ca7e6..4de98b87b65b3cf78ca0c61df5d542688c46f63a 100644 (file)
@@ -74,7 +74,7 @@ give(void)
            m = n + amt;
        sect.sct_item[ip->i_uid] = m;
        putsect(&sect);
-       if (sect.sct_own != 0 && m != n) {
+       if (sect.sct_own != 0 && sect.sct_own != player->cnum && m != n) {
            if (m > n) {
                if (opt_GODNEWS
                    && getnatp(sect.sct_own)->nat_stat != STAT_GOD)
index 8afafd46465032515f27cd3b12e470dec044bf08..64dfd3a9eba7e96a345b4c665ecc47cd2eb12517 100644 (file)
@@ -105,13 +105,13 @@ setsector(void)
                   prnatid(sect.sct_own), prnatid(amt));
                if (amt == sect.sct_own)
                    break;
-               if (sect.sct_own) {
+               if (sect.sct_own && sect.sct_own != player->cnum) {
                    wu(0, sect.sct_own,
                       "Sector %s taken from you by an act of %s!\n",
                       xyas(sect.sct_x, sect.sct_y, sect.sct_own),
                       cname(player->cnum));
                }
-               if (amt)
+               if (amt && amt != player->cnum)
                    wu(0, amt,
                       "Sector %s given to you by an act of %s!\n",
                       xyas(sect.sct_x, sect.sct_y, amt),
@@ -215,7 +215,7 @@ resnoise(struct sctstr *sptr, char *name, int old, int new)
 {
     pr("%s of %s changed from %d to %d\n",
        name, xyas(sptr->sct_x, sptr->sct_y, player->cnum), old, new);
-    if (sptr->sct_own && new != old)
+    if (sptr->sct_own && sptr->sct_own != player->cnum && new != old)
        wu(0, sptr->sct_own,
           "%s in %s was changed from %d to %d by an act of %s\n",
           name, xyas(sptr->sct_x, sptr->sct_y, sptr->sct_own),