Simplify tests for presence of load
Instead of counting the load with lnd_nland() / lnd_nxlight(), check whether there's at least one loaded with lnd_first_on_land() / pln_first_on_land().
This commit is contained in:
parent
3e370da58c
commit
9189e67ad7
2 changed files with 3 additions and 3 deletions
|
@ -529,7 +529,7 @@ load_land_ship(struct sctstr *sectp, struct shpstr *sp, int noisy,
|
|||
prland(&land), land.lnd_land);
|
||||
continue;
|
||||
}
|
||||
if (lnd_nland(&land)) {
|
||||
if (lnd_first_on_land(&land) >= 0) {
|
||||
if (noisy)
|
||||
pr("%s cannot be loaded since it is carrying units\n",
|
||||
prland(&land));
|
||||
|
@ -977,7 +977,7 @@ load_land_land(struct sctstr *sectp, struct lndstr *lp, int noisy,
|
|||
prland(&land), land.lnd_land);
|
||||
continue;
|
||||
}
|
||||
if (lnd_nland(&land)) {
|
||||
if (lnd_first_on_land(&land) >= 0) {
|
||||
if (noisy)
|
||||
pr("%s cannot be loaded since it is carrying units\n",
|
||||
prland(&land));
|
||||
|
|
|
@ -148,7 +148,7 @@ trade_desc(struct trdstr *tp, union empobj_storage *tgp)
|
|||
land.lnd_tech,
|
||||
land.lnd_effic,
|
||||
lchr[(int)land.lnd_type].l_name, land.lnd_uid);
|
||||
if (lnd_nxlight(&land)) {
|
||||
if (pln_first_on_land(&land) >= 0) {
|
||||
snxtitem_all(&ni, EF_PLANE);
|
||||
while (nxtitem(&ni, &plane)) {
|
||||
if (plane.pln_land == land.lnd_uid) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue