From e28c14f0237360611d66b6ae6964b7b01d1ed68a Mon Sep 17 00:00:00 2001 From: Ron Koenderink Date: Sun, 8 Jan 2006 19:12:04 +0000 Subject: [PATCH] (L_XLIGHT, lchr[], land_chr_flags[], take_plane_off_land, put_plane_on_land, load_plane_land, can_fly): Remove L_XLIGHT flag and replace with checks of lnd_maxlight. Closes #758459. --- include/land.h | 1 - src/lib/commands/load.c | 2 +- src/lib/global/land.c | 4 ++-- src/lib/global/nsc.c | 1 - src/lib/subs/aircombat.c | 4 +--- src/lib/subs/plnsub.c | 10 ++-------- 6 files changed, 6 insertions(+), 16 deletions(-) diff --git a/include/land.h b/include/land.h index 461e6e0cf..cf2047ced 100644 --- a/include/land.h +++ b/include/land.h @@ -128,7 +128,6 @@ struct lchrstr { }; /* Land unit ability flags */ -#define L_XLIGHT bit(0) /* Hold xlight planes */ #define L_ENGINEER bit(1) /* Do engineering things */ #define L_SUPPLY bit(2) /* supply other units/sects */ #define L_SECURITY bit(3) /* anti-terrorist troops */ diff --git a/src/lib/commands/load.c b/src/lib/commands/load.c index 66ef05c9f..598ab9d42 100644 --- a/src/lib/commands/load.c +++ b/src/lib/commands/load.c @@ -821,7 +821,7 @@ load_plane_land(struct sctstr *sectp, struct lndstr *lp, int noisy, s_char prompt[512]; s_char buf[1024]; - if (!(lchr[(int)lp->lnd_type].l_flags & L_XLIGHT)) { + if (!lp->lnd_maxlight) { if (noisy) pr("%s cannot carry extra-light planes.\n", prland(lp)); return 0; diff --git a/src/lib/global/land.c b/src/lib/global/land.c index 2edc4bae8..454eb1abf 100644 --- a/src/lib/global/land.c +++ b/src/lib/global/land.c @@ -100,7 +100,7 @@ struct lchrstr lchr[] = { "tra train", 100, 50, 0, 0, 0, 40, 3500, 0.0, 0.0, 120, 10, 25, 3, 0, 0, 0, 0, 0, 0, 0, 0, 5, 12, - L_XLIGHT | L_TRAIN | L_HEAVY | L_SUPPLY, + L_TRAIN | L_HEAVY | L_SUPPLY, }, {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, @@ -198,7 +198,7 @@ struct lchrstr lchr[] = { "rad radar unit", 10, 5, 0, 0, 0, 270, 1000, 0.0, 0.0, 50, 33, 15, 3, 0, 0, 0, 0, 0, 2, 25, 2, 1, 0, - L_XLIGHT | L_RADAR | L_LIGHT, + L_RADAR | L_LIGHT, }, /* name diff --git a/src/lib/global/nsc.c b/src/lib/global/nsc.c index f797c6085..f25061375 100644 --- a/src/lib/global/nsc.c +++ b/src/lib/global/nsc.c @@ -580,7 +580,6 @@ struct symbol ship_chr_flags[] = { }; struct symbol land_chr_flags[] = { - {L_XLIGHT, "xlight"}, {L_ENGINEER, "engineer"}, {L_SUPPLY, "supply"}, {L_SECURITY, "security"}, diff --git a/src/lib/subs/aircombat.c b/src/lib/subs/aircombat.c index 5d4679bfb..7d87320d9 100644 --- a/src/lib/subs/aircombat.c +++ b/src/lib/subs/aircombat.c @@ -1112,7 +1112,6 @@ can_fly(int p) struct lndstr land; struct plchrstr *pcp; struct mchrstr *scp; - struct lchrstr *lcp; getplane(p, &plane); pcp = &plchr[(int)plane.pln_type]; @@ -1149,9 +1148,8 @@ can_fly(int p) return 0; getland(plane.pln_land, &land); - lcp = &lchr[(int)land.lnd_type]; - if ((pcp->pl_flags & P_E) && (lcp->l_flags & L_XLIGHT)) { + if ((pcp->pl_flags & P_E) && land.lnd_maxlight) { return 1; } } diff --git a/src/lib/subs/plnsub.c b/src/lib/subs/plnsub.c index d9cfbbc23..c1932494d 100644 --- a/src/lib/subs/plnsub.c +++ b/src/lib/subs/plnsub.c @@ -922,14 +922,11 @@ int take_plane_off_land(struct plnstr *plane, struct lndstr *land) { struct plchrstr *pcp; - struct lchrstr *lcp; pcp = &plchr[(int)plane->pln_type]; - lcp = &lchr[(int)land->lnd_type]; /* Try to take off ship as an xlight plane */ - if ((pcp->pl_flags & P_E) && - (lcp->l_flags & L_XLIGHT) && (land->lnd_nxlight)) { + if ((pcp->pl_flags & P_E) && land->lnd_nxlight) { land->lnd_nxlight--; plane->pln_land = -1; @@ -1106,18 +1103,15 @@ int put_plane_on_land(struct plnstr *plane, struct lndstr *land) { struct plchrstr *pcp; - struct lchrstr *lcp; pcp = &plchr[(int)plane->pln_type]; - lcp = &lchr[(int)land->lnd_type]; if (((int)plane->pln_land) == ((int)land->lnd_uid)) return 1; /* Already on unit */ /* Try to put on unit as an xlight plane */ if ((pcp->pl_flags & P_E) && - (lcp->l_flags & L_XLIGHT) && - (land->lnd_nxlight < lcp->l_nxlight)) { + (land->lnd_nxlight < land->lnd_maxlight)) { land->lnd_nxlight++; plane->pln_x = land->lnd_x; -- 2.43.0