(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

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