From 67b9135e96fba21d29c26d1be4b9a3eca80f0d9f Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Sun, 6 Feb 2011 10:29:14 +0100 Subject: [PATCH] Use relations_with() in sendmessage() We know player != other. Because we can have only one player in state PS_PLAYING per country, and we know other->state == PS_PLAYING, it follows that player->cnum != other->cnum. Thus, no functional change. Adds another call to getnatp() hidden in relations_with(), though. Keeping that optimized isn't worth it. --- src/lib/commands/flash.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lib/commands/flash.c b/src/lib/commands/flash.c index 87c244a8..ffd0fb8d 100644 --- a/src/lib/commands/flash.c +++ b/src/lib/commands/flash.c @@ -140,7 +140,8 @@ sendmessage(struct natstr *to, char *message, int verbose) wto = getnatp(other->cnum); if (CANT_HAPPEN(!wto)) continue; - if (!player->god && getrel(wto, player->cnum) != ALLIED) + if (!player->god + && relations_with(other->cnum, player->cnum) != ALLIED) continue; } if (!player->god && !(wto->nat_flags & NF_FLASH)) {