(get_assembly_point): Close loophole that allowed players to find all

unowned sectors.  The assembly point must now be owned or allied, or
have an owned or allied ship.

Info pages didn't match the old rule.  Fix them to match the new rule.
This commit is contained in:
Markus Armbruster 2005-10-04 07:20:37 +00:00
parent 5a7670d9be
commit af32304af0
7 changed files with 31 additions and 11 deletions

View file

@ -31,7 +31,8 @@ Only missiles in hardened silos can avoid damage from a nuclear mission.
.s1 .s1
<SECT> represents an assembly point, where all of the planes in the <SECT> represents an assembly point, where all of the planes in the
mission meet before proceeding on to the target sector. mission meet before proceeding on to the target sector.
The assembly point must be owned by you, and must not be more than The assembly point must be owned by you or an ally, or you or an ally
must have a ship there. It must not be more than
four sectors away from any of the planes selected for the mission. four sectors away from any of the planes selected for the mission.
.s1 .s1
Route is a normal empire path specification. You may also give a Route is a normal empire path specification. You may also give a

View file

@ -17,7 +17,8 @@ To be selected, escorts must have fuel and mobility.
.s1 .s1
<SECT> represents an assembly point, where all of the planes in the <SECT> represents an assembly point, where all of the planes in the
mission meet before proceeding on to the target sector. mission meet before proceeding on to the target sector.
The assembly point must be owned by you, and must not be more than The assembly point must be owned by you or an ally, or you or an ally
must have a ship there. It must not be more than
four sectors away from any of the planes selected for the mission. four sectors away from any of the planes selected for the mission.
.s1 .s1
<COMMODITY> is the name of a commodity which is to be carried along <COMMODITY> is the name of a commodity which is to be carried along

View file

@ -16,7 +16,8 @@ To be selected, escorts must have fuel and mobility.
.s1 .s1
<SECT> represents an assembly point, where all of the planes in the <SECT> represents an assembly point, where all of the planes in the
mission meet before proceeding on to the target sector. mission meet before proceeding on to the target sector.
The assembly point must be owned by you, and must not be more than The assembly point must be owned by you or an ally, or you or an ally
must have a ship there. It must not be more than
four sectors away from any of the planes selected for the mission. four sectors away from any of the planes selected for the mission.
.s1 .s1
<COMMODITY> is the name of a commodity which is to be carried along <COMMODITY> is the name of a commodity which is to be carried along

View file

@ -19,7 +19,8 @@ To be selected, escorts must have fuel and mobility.
.s1 .s1
<SECT> represents an assembly point, where all of the planes in the <SECT> represents an assembly point, where all of the planes in the
mission meet before proceeding on to the target sector. mission meet before proceeding on to the target sector.
The assembly point must be owned by you, and must not be more than The assembly point must be owned by you or an ally, or you or an ally
must have a ship there. It must not be more than
four sectors away from any of the planes selected for the mission. four sectors away from any of the planes selected for the mission.
.s1 .s1
Route is a normal empire path specification. You may also give a Route is a normal empire path specification. You may also give a

View file

@ -18,7 +18,8 @@ To be selected, escorts must have fuel and mobility.
.s1 .s1
<SECT> represents an assembly point, where all of the planes in the <SECT> represents an assembly point, where all of the planes in the
mission meet before proceeding on to the target sector. mission meet before proceeding on to the target sector.
The assembly point must be owned by you, and must not be more than The assembly point must be owned by you or an ally, or you or an ally
must have a ship there. It must not be more than
four sectors away from any of the planes selected for the mission. four sectors away from any of the planes selected for the mission.
.s1 .s1
Route is a normal empire path specification. You may also give a Route is a normal empire path specification. You may also give a

View file

@ -17,7 +17,8 @@ To be selected, escorts must have fuel and mobility.
.s1 .s1
<SECT> represents an assembly point, where all of the planes in the <SECT> represents an assembly point, where all of the planes in the
mission meet before proceeding on to the target sector. mission meet before proceeding on to the target sector.
The assembly point must be owned by you, and must not be more than The assembly point must be owned by you or an ally, or you or an ally
must have a ship there. It must not be more than
four sectors away from any of the planes selected for the mission. four sectors away from any of the planes selected for the mission.
.s1 .s1
Route is a normal empire path specification. You may also give a Route is a normal empire path specification. You may also give a

View file

@ -64,18 +64,32 @@ get_assembly_point(char *input, struct sctstr *ap_sect, char *buf)
{ {
char *p; char *p;
coord x, y; coord x, y;
struct nstr_item ni;
struct shpstr ship;
p = getstarg(input, "assembly point? ", buf); p = getstarg(input, "assembly point? ", buf);
if (!p || *p == 0) if (!p || *p == 0)
return NULL; return NULL;
if (!sarg_xy(p, &x, &y) || !getsect(x, y, ap_sect)) if (!sarg_xy(p, &x, &y) || !getsect(x, y, ap_sect))
return NULL; return NULL;
if (ap_sect->sct_own && ap_sect->sct_own != player->cnum &&
getrel(getnatp(ap_sect->sct_own), player->cnum) != ALLIED) { /* over own or allied sector is fine */
pr("Assembly point not owned by you or an ally!\n"); if (ap_sect->sct_own == player->cnum
return NULL; || getrel(getnatp(ap_sect->sct_own), player->cnum) == ALLIED)
return ap_sect;
/* over own or allied ship is fine */
snxtitem_xy(&ni, EF_SHIP, x, y);
while (nxtitem(&ni, &ship)) {
if (ship.shp_effic < SHIP_MINEFF || ship.shp_own == 0)
continue;
if (ship.shp_own == player->cnum
|| getrel(getnatp(ship.shp_own), player->cnum) == ALLIED)
return ap_sect;
} }
return ap_sect;
pr("Assembly point not owned by you or an ally!\n");
return NULL;
} }
int int