Make load, unload, lload and lunload usable for deities
Fix ownership tests in load(), lload(), load_plane_ship(), load_land_ship(), load_plane_land(), load_land_land().
This commit is contained in:
parent
c4c7cac6fe
commit
2e6f971b6c
1 changed files with 13 additions and 17 deletions
|
@ -116,7 +116,7 @@ load(void)
|
||||||
if (!player->owner && (load_unload == UNLOAD)) {
|
if (!player->owner && (load_unload == UNLOAD)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (ship.shp_own != player->cnum) {
|
if (!player->owner) {
|
||||||
if (!noisy)
|
if (!noisy)
|
||||||
continue;
|
continue;
|
||||||
if (getrel(getnatp(ship.shp_own), player->cnum) < FRIENDLY)
|
if (getrel(getnatp(ship.shp_own), player->cnum) < FRIENDLY)
|
||||||
|
@ -124,15 +124,13 @@ load(void)
|
||||||
}
|
}
|
||||||
if (!getsect(ship.shp_x, ship.shp_y, §)) /* XXX */
|
if (!getsect(ship.shp_x, ship.shp_y, §)) /* XXX */
|
||||||
continue;
|
continue;
|
||||||
if ((sect.sct_own != player->cnum) &&
|
if (!player->owner && ship.shp_own != player->cnum)
|
||||||
(ship.shp_own != player->cnum))
|
|
||||||
continue;
|
continue;
|
||||||
if (!player->owner &&
|
if (!player->owner && !sect_has_dock(§))
|
||||||
!sect_has_dock(§))
|
|
||||||
continue;
|
continue;
|
||||||
if (!sect.sct_own)
|
if (!sect.sct_own)
|
||||||
continue;
|
continue;
|
||||||
if ((sect.sct_own != player->cnum) && (load_unload == LOAD)) {
|
if (!player->owner && load_unload == LOAD) {
|
||||||
if (noisy)
|
if (noisy)
|
||||||
pr("You don't own %s \n",
|
pr("You don't own %s \n",
|
||||||
xyas(ship.shp_x, ship.shp_y, player->cnum));
|
xyas(ship.shp_x, ship.shp_y, player->cnum));
|
||||||
|
@ -144,7 +142,7 @@ load(void)
|
||||||
xyas(ship.shp_x, ship.shp_y, player->cnum));
|
xyas(ship.shp_x, ship.shp_y, player->cnum));
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (sect.sct_own != player->cnum && load_unload == UNLOAD
|
if (!player->owner && load_unload == UNLOAD
|
||||||
&& getrel(getnatp(sect.sct_own), player->cnum) < FRIENDLY) {
|
&& getrel(getnatp(sect.sct_own), player->cnum) < FRIENDLY) {
|
||||||
if (noisy)
|
if (noisy)
|
||||||
pr("You can't unload into an unfriendly %s\n",
|
pr("You can't unload into an unfriendly %s\n",
|
||||||
|
@ -251,7 +249,7 @@ lload(void)
|
||||||
continue;
|
continue;
|
||||||
if (!player->owner && load_unload == UNLOAD)
|
if (!player->owner && load_unload == UNLOAD)
|
||||||
continue;
|
continue;
|
||||||
if (player->cnum != land.lnd_own) {
|
if (!player->owner) {
|
||||||
if (!noisy)
|
if (!noisy)
|
||||||
continue;
|
continue;
|
||||||
if (getrel(getnatp(land.lnd_own), player->cnum) != ALLIED)
|
if (getrel(getnatp(land.lnd_own), player->cnum) != ALLIED)
|
||||||
|
@ -260,16 +258,15 @@ lload(void)
|
||||||
|
|
||||||
if (!getsect(land.lnd_x, land.lnd_y, §)) /* XXX */
|
if (!getsect(land.lnd_x, land.lnd_y, §)) /* XXX */
|
||||||
continue;
|
continue;
|
||||||
|
if (!player->owner && land.lnd_own != player->cnum)
|
||||||
if (sect.sct_own != player->cnum && land.lnd_own != player->cnum)
|
|
||||||
continue;
|
continue;
|
||||||
if (sect.sct_own != player->cnum && load_unload == LOAD) {
|
if (!player->owner && load_unload == LOAD) {
|
||||||
if (noisy)
|
if (noisy)
|
||||||
pr("Sector %s is not yours.\n",
|
pr("Sector %s is not yours.\n",
|
||||||
xyas(sect.sct_x, sect.sct_y, player->cnum));
|
xyas(sect.sct_x, sect.sct_y, player->cnum));
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (sect.sct_own != player->cnum &&
|
if (!player->owner &&
|
||||||
getrel(getnatp(sect.sct_own), player->cnum) != ALLIED) {
|
getrel(getnatp(sect.sct_own), player->cnum) != ALLIED) {
|
||||||
pr("Sector %s is not yours.\n",
|
pr("Sector %s is not yours.\n",
|
||||||
xyas(land.lnd_x, land.lnd_y, player->cnum));
|
xyas(land.lnd_x, land.lnd_y, player->cnum));
|
||||||
|
@ -432,7 +429,7 @@ load_plane_ship(struct sctstr *sectp, struct shpstr *sp, int noisy,
|
||||||
noisy = isdigit(*p);
|
noisy = isdigit(*p);
|
||||||
|
|
||||||
while (nxtitem(&ni, &pln)) {
|
while (nxtitem(&ni, &pln)) {
|
||||||
if (pln.pln_own != player->cnum)
|
if (!player->owner)
|
||||||
continue;
|
continue;
|
||||||
if (!(plchr[(int)pln.pln_type].pl_flags & P_L)
|
if (!(plchr[(int)pln.pln_type].pl_flags & P_L)
|
||||||
&& !(plchr[(int)pln.pln_type].pl_flags & P_E)
|
&& !(plchr[(int)pln.pln_type].pl_flags & P_E)
|
||||||
|
@ -565,7 +562,7 @@ load_land_ship(struct sctstr *sectp, struct shpstr *sp, int noisy,
|
||||||
noisy = isdigit(*p);
|
noisy = isdigit(*p);
|
||||||
|
|
||||||
while (nxtitem(&ni, &land)) {
|
while (nxtitem(&ni, &land)) {
|
||||||
if (land.lnd_own != player->cnum)
|
if (!player->owner)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (load_unload == LOAD) {
|
if (load_unload == LOAD) {
|
||||||
|
@ -777,7 +774,7 @@ load_plane_land(struct sctstr *sectp, struct lndstr *lp, int noisy,
|
||||||
noisy = isdigit(*p);
|
noisy = isdigit(*p);
|
||||||
|
|
||||||
while (nxtitem(&ni, &pln)) {
|
while (nxtitem(&ni, &pln)) {
|
||||||
if (pln.pln_own != player->cnum)
|
if (!player->owner)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (!(plchr[(int)pln.pln_type].pl_flags & P_E)) {
|
if (!(plchr[(int)pln.pln_type].pl_flags & P_E)) {
|
||||||
|
@ -937,8 +934,7 @@ load_land_land(struct sctstr *sectp, struct lndstr *lp, int noisy,
|
||||||
noisy = isdigit(*p);
|
noisy = isdigit(*p);
|
||||||
|
|
||||||
while (nxtitem(&ni, &land)) {
|
while (nxtitem(&ni, &land)) {
|
||||||
|
if (!player->owner)
|
||||||
if (land.lnd_own != player->cnum)
|
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (load_unload == LOAD) {
|
if (load_unload == LOAD) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue