]> git.pond.sub.org Git - empserver/commitdiff
reject: Clean up typed_wu()'s check for deity
authorMarkus Armbruster <armbru@pond.sub.org>
Mon, 31 Oct 2016 10:18:02 +0000 (11:18 +0100)
committerMarkus Armbruster <armbru@pond.sub.org>
Sun, 6 Aug 2017 18:09:21 +0000 (20:09 +0200)
When sending a telegram, typed_wu() checks whether the recipient is
rejecting telegrams.  The check tacitly assumes from == player->cnum.
Happens to be the case, but clean it up anyway.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
src/lib/subs/wu.c

index e4a6d785de134161f6f036c1a3c09f6f18306bcf..d97b3c9f033fb175e9f1e44f5825acc5cd452ddf 100644 (file)
@@ -28,7 +28,7 @@
  *
  *  Known contributors to this file:
  *     Steve McClure, 2000
- *     Markus Armbruster, 2005-2015
+ *     Markus Armbruster, 2005-2016
  */
 
 #include <config.h>
@@ -40,7 +40,6 @@
 #include "misc.h"
 #include "nat.h"
 #include "optlist.h"
-#include "player.h"
 #include "prototypes.h"
 #include "tel.h"
 #include "update.h"
@@ -154,7 +153,8 @@ typed_wu(natid from, natid to, char *message, int type)
        for (to = 0; NULL != (np = getnatp(to)); to++) {
            if (np->nat_stat < STAT_SANCT)
                continue;
-           if (!player->god && (getrejects(from, np) & REJ_ANNO))
+           if (getnatp(from)->nat_stat != STAT_GOD
+               && (getrejects(from, np) & REJ_ANNO))
                continue;
            if (!np->nat_ann || !tel.tel_cont) {
                np->nat_ann++;