Fix test for capital in caploss() to check country status

Test for STAT_ACTIVE instead of non-zero country number.  Inactive
countries have no capital they could lose!
This commit is contained in:
Markus Armbruster 2008-05-11 10:20:40 +02:00
parent ba5c360ca7
commit a16af46af9

View file

@ -54,9 +54,9 @@ caploss(struct sctstr *sp, natid coun, char *msg)
int loan_num = 0; int loan_num = 0;
int comm_num = 0; int comm_num = 0;
if (coun == 0)
return;
natp = getnatp(coun); natp = getnatp(coun);
if (natp->nat_stat != STAT_ACTIVE)
return;
if (sp->sct_x != natp->nat_xcap || sp->sct_y != natp->nat_ycap) if (sp->sct_x != natp->nat_xcap || sp->sct_y != natp->nat_ycap)
return; return;
if (coun == player->cnum) if (coun == player->cnum)