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.
This commit is contained in:
parent
6852ec6bc5
commit
67b9135e96
1 changed files with 2 additions and 1 deletions
|
@ -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)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue