(trad, set): Treat trade file slots with zero owner as unused, so that

freshly extended trade file makes sense.  When set() removes a lot,
simply zero the slot.

(set): Initialize trd_uid.

(trade_check_ok): Use check_land_ok() & friends instead of doing it by
hand, but wrong.  This fixes bying planes and land units loaded on
ships that moved after loading.

(check_trade_ok): New.
(trade_check_ok): Use it.  Remove unused argument lot.  Callers
changed.
This commit is contained in:
Markus Armbruster 2004-08-28 15:22:50 +00:00
parent 133c1754f9
commit e16e38dfab
6 changed files with 52 additions and 47 deletions

View file

@ -161,3 +161,16 @@ check_comm_ok(struct comstr *commp)
}
return 1;
}
int
check_trade_ok(struct trdstr *tp)
{
struct trdstr chktrade;
gettrade(tp->trd_uid, &chktrade);
if (memcmp(tp, &chktrade, sizeof(struct trdstr))) {
pr("Trade lot #%d has changed!\n", tp->trd_uid);
return 0;
}
return 1;
}