(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.
This commit is contained in:
Ron Koenderink 2006-01-08 19:12:04 +00:00
parent cf384676e8
commit e28c14f023
6 changed files with 6 additions and 16 deletions

View file

@ -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 */

View file

@ -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;

View file

@ -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

View file

@ -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"},

View file

@ -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;
}
}

View file

@ -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;