X-Git-Url: http://git.pond.sub.org/?p=empserver;a=blobdiff_plain;f=src%2Flib%2Fsubs%2Fwu.c;h=6bcaf0009bffe8d415ad86c5e61fa88a34c5c43e;hp=d40af3e79474555147fe0d18c428eb520c4070f3;hb=e23882161e21b6e14dc9283933967d344f231954;hpb=55be3c7105c1b925bbddf2d822ec3164eceb2243 diff --git a/src/lib/subs/wu.c b/src/lib/subs/wu.c index d40af3e79..6bcaf0009 100644 --- a/src/lib/subs/wu.c +++ b/src/lib/subs/wu.c @@ -1,6 +1,6 @@ /* * Empire - A multi-player, client/server Internet based war game. - * Copyright (C) 1986-2016, Dave Pare, Jeff Bailey, Thomas Ruschak, + * Copyright (C) 1986-2021, Dave Pare, Jeff Bailey, Thomas Ruschak, * Ken Stevens, Steve McClure, Markus Armbruster * * Empire is free software: you can redistribute it and/or modify @@ -28,7 +28,7 @@ * * Known contributors to this file: * Steve McClure, 2000 - * Markus Armbruster, 2005-2015 + * Markus Armbruster, 2005-2021 */ #include @@ -37,11 +37,9 @@ #include #include #include -#include "file.h" #include "misc.h" #include "nat.h" #include "optlist.h" -#include "player.h" #include "prototypes.h" #include "tel.h" #include "update.h" @@ -112,14 +110,16 @@ typed_wu(natid from, natid to, char *message, int type) char box[1024]; struct player *other; - if (type == TEL_ANNOUNCE) + if (type == TEL_ANNOUNCE) { strcpy(box, annfil); - else + np = NULL; + } else { mailbox(box, to); - - if (type != TEL_ANNOUNCE) - if (!(np = getnatp(to)) || np->nat_stat < STAT_SANCT) + np = getnatp(to); + if (!np || np->nat_stat < STAT_SANCT) return -1; + } + #if !defined(_WIN32) if ((fd = open(box, O_WRONLY | O_APPEND, 0)) < 0) { #else @@ -155,7 +155,7 @@ 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 (!nat_accepts(to, from, REJ_ANNO)) continue; if (!np->nat_ann || !tel.tel_cont) { np->nat_ann++;