From 57f589e2e4b343b39cada28c27c3f554fc3a66f3 Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Fri, 23 Nov 2007 18:50:46 +0000 Subject: [PATCH] (M_XLIGHT, M_CHOPPER): Redundant, remove. (init_mchr): Don't set them. (carrier_planes): Use m_nxlight, m_nchoppers instead. --- include/ship.h | 6 ++---- src/lib/global/init.c | 4 ---- src/lib/global/ship.config | 6 ++---- src/lib/subs/plnsub.c | 4 ++-- 4 files changed, 6 insertions(+), 14 deletions(-) diff --git a/include/ship.h b/include/ship.h index bda8c6df..aed144f4 100644 --- a/include/ship.h +++ b/include/ship.h @@ -150,10 +150,8 @@ struct mchrstr { #define M_SUBT bit(12) /* allows torping of other subs */ #define M_TRADE bit(13) /* is a trade ship */ #define M_SEMILAND bit(14) /* can land 1/4 */ -/* M_XLIGHT will be automatically set in init_mchr() if m_nxlight > 0 */ -#define M_XLIGHT bit(15) /* can hold xlight planes */ -/* M_CHOPPER will be automatically set in init_mchr() if m_nchoppers > 0 */ -#define M_CHOPPER bit(16) /* can hold choppers */ +/* unused bit(15) */ +/* unused bit(16) */ #define M_OILER bit(17) /* can re-fuel ships */ #define M_SUPPLY bit(18) /* Can supply units/sects/ships */ #define M_CANAL bit(19) /* Can navigate a canal (BIG CITY) */ diff --git a/src/lib/global/init.c b/src/lib/global/init.c index e9adcad5..8b1fe000 100644 --- a/src/lib/global/init.c +++ b/src/lib/global/init.c @@ -62,10 +62,6 @@ init_mchr(void) struct mchrstr *mp; for (mp = mchr; mp->m_name; mp++) { - if (mp->m_nxlight) - mp->m_flags |= M_XLIGHT; - if (mp->m_nchoppers) - mp->m_flags |= M_CHOPPER; if (mp->m_nplanes && !(mp->m_flags & M_MSL || mp->m_flags & M_FLY)) mp->m_flags |= M_MSL; } diff --git a/src/lib/global/ship.config b/src/lib/global/ship.config index 97912727..d1fc3e8c 100644 --- a/src/lib/global/ship.config +++ b/src/lib/global/ship.config @@ -41,10 +41,8 @@ # Available flags are in ship_chr_flags[]. info Ship-types should # document them all. # -# Note that you can't set the flags M_XLIGHT or M_CHOPPER here. They -# will be automatically set by init_mchr() if the ship can carry a -# non-zero amount of those things. Also note that if nplanes > 0 and -# flag plane is not set, then flag miss will automatically be set. +# Note that if nplanes > 0 and flag plane is not set, then flag miss +# will automatically be set. # Do not edit this file to customize a game! Create your own custom # configuration file(s), best next to your econfig, and name them in diff --git a/src/lib/subs/plnsub.c b/src/lib/subs/plnsub.c index 6c3b31b9..87ffcd65 100644 --- a/src/lib/subs/plnsub.c +++ b/src/lib/subs/plnsub.c @@ -397,9 +397,9 @@ carrier_planes(struct shpstr *sp, int msl) res |= P_L; if ((mcp->m_flags & M_MSL) && msl) res |= P_L; - if ((mcp->m_flags & M_CHOPPER) && !msl) + if (mcp->m_nchoppers && !msl) res |= P_K; - if (mcp->m_flags & M_XLIGHT) + if (mcp->m_nxlight) res |= P_E; return res; }