Remove option LANDSPIES, customize table land-chr instead

Spy units are now enabled when a land unit type with capability spy
exists.  To disable them, deities have to customize table land-chr.

Before, spy units types were ignored when option LANDSPIES was
disabled.  Except for xdump land-chr, which happily dumped unusable
spy unit types.
This commit is contained in:
Markus Armbruster 2011-05-22 17:04:46 +02:00
parent 352bc320d2
commit 93edcf0ac4
9 changed files with 18 additions and 31 deletions

View file

@ -134,11 +134,8 @@ buil(void)
break;
case 'l':
type = ef_elt_byname(EF_LAND_CHR, p);
if (type >= 0) {
if (type >= 0)
rqtech = lchr[type].l_tech;
if ((lchr[type].l_flags & L_SPY) && !opt_LANDSPIES)
type = -1;
}
break;
case 'n':
type = ef_elt_byname(EF_NUKE_CHR, p);

View file

@ -518,16 +518,14 @@ load_land_ship(struct sctstr *sectp, struct shpstr *sp, int noisy,
int load_spy = 0;
if (load_unload == LOAD) {
if (opt_LANDSPIES) {
if ((mchr[(int)sp->shp_type].m_flags & M_SUB) &&
(mchr[(int)sp->shp_type].m_nland == 0)) {
if (shp_nland(sp) >= 2) {
pr("Non-land unit carrying subs can only carry up to two spy units.\n");
return 0;
}
/* Eh, let 'em load a spy only */
load_spy = 1;
if ((mchr[(int)sp->shp_type].m_flags & M_SUB) &&
(mchr[(int)sp->shp_type].m_nland == 0)) {
if (shp_nland(sp) >= 2) {
pr("Non-land unit carrying subs can only carry up to two spy units.\n");
return 0;
}
/* Eh, let 'em load a spy only */
load_spy = 1;
}
if (!load_spy && shp_nland(sp) >= mchr[sp->shp_type].m_nland) {
if (noisy) {
@ -612,16 +610,14 @@ load_land_ship(struct sctstr *sectp, struct shpstr *sp, int noisy,
/* Fit unit on ship */
if (load_unload == LOAD) {
/* We have to check again, since it may have changed */
if (opt_LANDSPIES) {
if ((mchr[(int)sp->shp_type].m_flags & M_SUB) &&
(mchr[(int)sp->shp_type].m_nland == 0)) {
if (shp_nland(sp) >= 2) {
pr("Non-land unit carrying subs can only carry up to two spy units.\n");
return 0;
}
/* Eh, let 'em load a spy only */
load_spy = 1;
if ((mchr[(int)sp->shp_type].m_flags & M_SUB) &&
(mchr[(int)sp->shp_type].m_nland == 0)) {
if (shp_nland(sp) >= 2) {
pr("Non-land unit carrying subs can only carry up to two spy units.\n");
return 0;
}
/* Eh, let 'em load a spy only */
load_spy = 1;
}
if (!load_spy && shp_nland(sp) >= mchr[sp->shp_type].m_nland) {
if (noisy) {