]> git.pond.sub.org Git - empserver/commitdiff
(L_XLIGHT, lchr[], land_chr_flags[], take_plane_off_land,
authorRon Koenderink <rkoenderink@yahoo.ca>
Sun, 8 Jan 2006 19:12:04 +0000 (19:12 +0000)
committerRon Koenderink <rkoenderink@yahoo.ca>
Sun, 8 Jan 2006 19:12:04 +0000 (19:12 +0000)
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
src/lib/commands/load.c
src/lib/global/land.c
src/lib/global/nsc.c
src/lib/subs/aircombat.c
src/lib/subs/plnsub.c

index 461e6e0cf99e8e132ca523b34952fa42d2ee2f28..cf2047ced44a5e2661129e05997497a22eab0ecb 100644 (file)
@@ -128,7 +128,6 @@ struct lchrstr {
 };
 
 /* Land unit ability flags */
 };
 
 /* 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 */
 #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 */
index 66ef05c9ffce6bc81a872038e154a26b569a943d..598ab9d42673a08365cb85073d3d472c7d5442dc 100644 (file)
@@ -821,7 +821,7 @@ load_plane_land(struct sctstr *sectp, struct lndstr *lp, int noisy,
     s_char prompt[512];
     s_char buf[1024];
 
     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;
        if (noisy)
            pr("%s cannot carry extra-light planes.\n", prland(lp));
        return 0;
index 2edc4bae87327f3a1cbd65bffe596c41a6570ccf..454eb1abf2824d79b382ec2bab853a04dac4ac11 100644 (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,
      "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},
      },
 
     {{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,
      "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
      },
 
 /* name
index f797c60850cd1d1fe6de51f26207f6c293d7b26b..f25061375ab19f26d1c4afc82134e770637b66fa 100644 (file)
@@ -580,7 +580,6 @@ struct symbol ship_chr_flags[] = {
 };
 
 struct symbol land_chr_flags[] = {
 };
 
 struct symbol land_chr_flags[] = {
-    {L_XLIGHT, "xlight"},
     {L_ENGINEER, "engineer"},
     {L_SUPPLY, "supply"},
     {L_SECURITY, "security"},
     {L_ENGINEER, "engineer"},
     {L_SUPPLY, "supply"},
     {L_SECURITY, "security"},
index 5d4679bfb29e4c1e849ad3d5ce93ce042c7c710a..7d87320d901ebb0eda395fd909fc6a30f44b5915 100644 (file)
@@ -1112,7 +1112,6 @@ can_fly(int p)
     struct lndstr land;
     struct plchrstr *pcp;
     struct mchrstr *scp;
     struct lndstr land;
     struct plchrstr *pcp;
     struct mchrstr *scp;
-    struct lchrstr *lcp;
 
     getplane(p, &plane);
     pcp = &plchr[(int)plane.pln_type];
 
     getplane(p, &plane);
     pcp = &plchr[(int)plane.pln_type];
@@ -1149,9 +1148,8 @@ can_fly(int p)
            return 0;
 
        getland(plane.pln_land, &land);
            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;
        }
     }
            return 1;
        }
     }
index d9cfbbc2310ce43267671039907cfc6125bd9cb9..c1932494dddc3ffba00b854391e9f0159e57661f 100644 (file)
@@ -922,14 +922,11 @@ int
 take_plane_off_land(struct plnstr *plane, struct lndstr *land)
 {
     struct plchrstr *pcp;
 take_plane_off_land(struct plnstr *plane, struct lndstr *land)
 {
     struct plchrstr *pcp;
-    struct lchrstr *lcp;
 
     pcp = &plchr[(int)plane->pln_type];
 
     pcp = &plchr[(int)plane->pln_type];
-    lcp = &lchr[(int)land->lnd_type];
 
     /* Try to take off ship as an xlight plane */
 
     /* 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;
 
        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;
 put_plane_on_land(struct plnstr *plane, struct lndstr *land)
 {
     struct plchrstr *pcp;
-    struct lchrstr *lcp;
 
     pcp = &plchr[(int)plane->pln_type];
 
     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) &&
 
     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;
 
        land->lnd_nxlight++;
        plane->pln_x = land->lnd_x;