Make lload require own sector and lunload own land unit
This is for consistency with load and unload. Before, you could use lunload for allied land units and lload in allied sectors, but the command failed when stuff was loaded in allied sectors. Doing that with lload no longer fails the command, because the check that does that in load_comm_land() is now masked by the new checks in lload(). Note that loading with lunload still fails the command; that inconsistency will be removed in a later commit. load_plane_land() already refused to load planes from foreign sectors. This commit makes that check redundant, so remove it. Functional change: lload now refuses to load foreign planes silently, unless both land unit and plane were named by number. This is consistent with load.
This commit is contained in:
parent
17d19266dc
commit
bf2fd042ab
1 changed files with 8 additions and 6 deletions
|
@ -248,6 +248,8 @@ lload(void)
|
|||
while (nxtitem(&nbst, &land)) {
|
||||
if (land.lnd_own == 0)
|
||||
continue;
|
||||
if (!player->owner && load_unload == UNLOAD)
|
||||
continue;
|
||||
if (player->cnum != land.lnd_own) {
|
||||
if (!noisy)
|
||||
continue;
|
||||
|
@ -267,6 +269,12 @@ lload(void)
|
|||
}
|
||||
}
|
||||
|
||||
if (sect.sct_own != player->cnum && load_unload == LOAD) {
|
||||
if (noisy)
|
||||
pr("Sector %s is not yours.\n",
|
||||
xyas(sect.sct_x, sect.sct_y, player->cnum));
|
||||
continue;
|
||||
}
|
||||
if (sect.sct_own != player->cnum &&
|
||||
getrel(getnatp(sect.sct_own), player->cnum) != ALLIED) {
|
||||
pr("Sector %s is not yours.\n",
|
||||
|
@ -744,12 +752,6 @@ load_plane_land(struct sctstr *sectp, struct lndstr *lp, int noisy,
|
|||
if (noisy && p && *p)
|
||||
noisy = isdigit(*p);
|
||||
|
||||
if (sectp->sct_own != player->cnum && load_unload == LOAD) {
|
||||
pr("Sector %s is not yours.\n",
|
||||
xyas(lp->lnd_x, lp->lnd_y, player->cnum));
|
||||
return 0;
|
||||
}
|
||||
|
||||
while (nxtitem(&ni, &pln)) {
|
||||
if (pln.pln_own != player->cnum)
|
||||
continue;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue