Optimize sendmessage() use of getnatp()
Don't call it when its value must be TO anyway. While there, oops when it fails instead of recovering silently.
This commit is contained in:
parent
fc633a4f1f
commit
e21f5035cb
1 changed files with 7 additions and 2 deletions
|
@ -131,8 +131,13 @@ sendmessage(struct natstr *us, struct natstr *to, char *message, int verbose)
|
|||
continue;
|
||||
if (to && other->cnum != to->nat_cnum)
|
||||
continue;
|
||||
if (!(wto = getnatp(other->cnum)))
|
||||
continue;
|
||||
if (to)
|
||||
wto = to;
|
||||
else {
|
||||
wto = getnatp(other->cnum);
|
||||
if (CANT_HAPPEN(!wto))
|
||||
continue;
|
||||
}
|
||||
if (!to && !player->god && getrel(wto, player->cnum) != ALLIED)
|
||||
continue;
|
||||
if (!player->god && !(wto->nat_flags & NF_FLASH)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue