From 93edcf0ac403b3c5f7832e66d26805c340b9441a Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Sun, 22 May 2011 17:04:46 +0200 Subject: [PATCH] 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. --- include/econfig-spec.h | 2 -- info/History.t | 2 +- info/Options.t | 1 - info/Ship-types.t | 2 +- info/version.t | 2 +- src/lib/commands/buil.c | 5 +---- src/lib/commands/load.c | 32 ++++++++++++++------------------ src/lib/global/options.c | 1 - src/lib/subs/show.c | 2 -- 9 files changed, 18 insertions(+), 31 deletions(-) diff --git a/include/econfig-spec.h b/include/econfig-spec.h index 0b0c8b157..59e27c010 100644 --- a/include/econfig-spec.h +++ b/include/econfig-spec.h @@ -162,8 +162,6 @@ EMPCF_OPT("HIDDEN", opt_HIDDEN, "Hide information between players") EMPCF_OPT("INTERDICT_ATT", opt_INTERDICT_ATT, "Interdict post-attack move in") -EMPCF_OPT("LANDSPIES", opt_LANDSPIES, - "Enable the land unit type spies") EMPCF_OPT("LOANS", opt_LOANS, "Allow bailing out of other countries via S&L scandals") EMPCF_OPT("LOSE_CONTACT", opt_LOSE_CONTACT, diff --git a/info/History.t b/info/History.t index fcf387e1e..ae504d83c 100644 --- a/info/History.t +++ b/info/History.t @@ -239,7 +239,7 @@ NEW_STARVE, NEW_WORK, ORBIT and PLANENAMES are no longer configurable. Options NUKEFAILDETONATE, SLOW_WAR, SNEAK_ATTACK, FUEL, GRAB_THINGS and SHIP_DECAY are gone. Options PINPOINTMISSILE, DEMANDUPDATE, UPDATESCHED, DRNUKE, TRADESHIPS, NONUKES, NEUTRON, BIG_CITY, -DEFENSE_INFRA, NO_LCMS, NO_HCMS and NO_OIL +DEFENSE_INFRA, LANDSPIES, NO_LCMS, NO_HCMS and NO_OIL got replaced by more flexible configuration. The xdump command lets client writers access more game more easily. diff --git a/info/Options.t b/info/Options.t index b3a8eceaa..1f1a1bfcb 100644 --- a/info/Options.t +++ b/info/Options.t @@ -36,7 +36,6 @@ GO_RENEW: Gold and Oil are renewable resources. MOB_ACCESS: Allows real-time updating of mobility. MARKET: Time-delay market and trade. LOANS: Allows S&L type interaction between countries. -LANDSPIES: Creates land unit style spies. NO_FORT_FIRE: Forts cannot fire. RAILWAYS Highways double as rail TECH_POP: Technology costs more to make as your civilian population diff --git a/info/Ship-types.t b/info/Ship-types.t index 8cfa85b5d..6c67a58b1 100644 --- a/info/Ship-types.t +++ b/info/Ship-types.t @@ -207,7 +207,7 @@ the number of guns the ship can fire at once .L lnd The number of land units the ship can carry. No ship can carry 'heavy' units. Only surface supply ships can carry units that are not 'light'. -If option LANDSPIES is enabled, submarines that can't normally carry +Submarines that can't normally carry land units can carry up to two spies. .L pln The number of 'light' planes the ship can carry. diff --git a/info/version.t b/info/version.t index e76bd6c5c..8380175f2 100644 --- a/info/version.t +++ b/info/version.t @@ -76,7 +76,7 @@ You are disconnected after 15 minutes of idle time. Options enabled in this game: ALL_BLEED, BLITZ, EASY_BRIDGES, FALLOUT, GODNEWS, INTERDICT_ATT, - LANDSPIES, NOFOOD, NOMOBCOST, NO_PLAGUE, RAILWAYS, SAIL, TREATIES + NOFOOD, NOMOBCOST, NO_PLAGUE, RAILWAYS, SAIL, TREATIES Options disabled in this game: AUTO_POWER, BRIDGETOWERS, GO_RENEW, GUINEA_PIGS, HIDDEN, LOANS, diff --git a/src/lib/commands/buil.c b/src/lib/commands/buil.c index 4c4c0299c..01ac73ad7 100644 --- a/src/lib/commands/buil.c +++ b/src/lib/commands/buil.c @@ -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); diff --git a/src/lib/commands/load.c b/src/lib/commands/load.c index 6b3886b52..dc0950f7f 100644 --- a/src/lib/commands/load.c +++ b/src/lib/commands/load.c @@ -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) { diff --git a/src/lib/global/options.c b/src/lib/global/options.c index a9487ce91..3968592c7 100644 --- a/src/lib/global/options.c +++ b/src/lib/global/options.c @@ -46,7 +46,6 @@ int opt_GO_RENEW = 0; int opt_GUINEA_PIGS = 0; int opt_HIDDEN = 0; int opt_INTERDICT_ATT = 1; -int opt_LANDSPIES = 1; int opt_LOANS = 0; int opt_LOSE_CONTACT = 0; int opt_MARKET = 0; diff --git a/src/lib/subs/show.c b/src/lib/subs/show.c index c8f7f791a..3ff4972ef 100644 --- a/src/lib/subs/show.c +++ b/src/lib/subs/show.c @@ -125,8 +125,6 @@ make_lchr_index(struct chr_index chridx[], int tlev) continue; if (lchr[i].l_tech > tlev) continue; - if ((lchr[i].l_flags & L_SPY) && !opt_LANDSPIES) - continue; chridx[n].type = i; chridx[n].tech = lchr[i].l_tech; n++; -- 2.43.0