]> git.pond.sub.org Git - empserver/blobdiff - src/lib/commands/buil.c
Remove unused members of struct lndstr, lonstr, nukstr, trtstr
[empserver] / src / lib / commands / buil.c
index 4cd38f1d551ad8ec1e35ec3b66a4b7e52fcc4b96..9ebe6f6ee3ea6adc146f67809e9882838da3df76 100644 (file)
@@ -29,7 +29,7 @@
  *
  *  Known contributors to this file:
  *      Steve McClure, 1998-2000
- *      Markus Armbruster, 2004-2008
+ *      Markus Armbruster, 2004-2009
  */
 
 #include <config.h>
@@ -89,7 +89,7 @@ buil(void)
     p = getstarg(player->argp[1],
                 "Build (ship, nuke, bridge, plane, land unit, tower)? ",
                 buf);
-    if (p == 0)
+    if (!p)
        return RET_SYN;
     what = *p;
 
@@ -103,7 +103,7 @@ buil(void)
     switch (what) {
     case 'p':
        p = getstarg(player->argp[3], "Plane type? ", buf);
-       if (p == 0 || *p == 0)
+       if (!p || !*p)
            return RET_SYN;
        type = ef_elt_byname(EF_PLANE_CHR, p);
        if (type >= 0) {
@@ -121,7 +121,7 @@ buil(void)
        break;
     case 's':
        p = getstarg(player->argp[3], "Ship type? ", buf);
-       if (p == 0 || *p == 0)
+       if (!p || !*p)
            return RET_SYN;
        type = ef_elt_byname(EF_SHIP_CHR, p);
        if (type >= 0) {
@@ -141,7 +141,7 @@ buil(void)
        break;
     case 'l':
        p = getstarg(player->argp[3], "Land unit type? ", buf);
-       if (p == 0 || *p == 0)
+       if (!p || !*p)
            return RET_SYN;
        type = ef_elt_byname(EF_LAND_CHR, p);
        if (type >= 0) {
@@ -182,7 +182,7 @@ buil(void)
            return RET_FAIL;
        }
        p = getstarg(player->argp[3], "Nuke type? ", buf);
-       if (p == 0 || *p == 0)
+       if (!p || !*p)
            return RET_SYN;
        type = ef_elt_byname(EF_NUKE_CHR, p);
        if (type >= 0) {
@@ -219,7 +219,7 @@ buil(void)
                        "Are you sure that you want to build %s of them? ",
                        player->argp[4]);
                p = getstarg(player->argp[6], bstr, buf);
-               if (p == 0 || *p != 'y')
+               if (!p || *p != 'y')
                    return RET_SYN;
            }
        }
@@ -458,7 +458,6 @@ build_land(struct sctstr *sp, struct lchrstr *lp, short *vec, int tlev)
     } else {
        land.lnd_mobil = 0;
     }
-    land.lnd_flags = 0;
     land.lnd_ship = -1;
     land.lnd_land = -1;
     land.lnd_harden = 0;
@@ -652,7 +651,7 @@ build_nuke(struct sctstr *sp, struct nchrstr *np, short *vec, int tlev)
     nuke.nuk_own = sp->sct_own;
     nuke.nuk_type = np - nchr;
     nuke.nuk_effic = 100;
-    nuke.nuk_ship = nuke.nuk_plane = nuke.nuk_land = -1;
+    nuke.nuk_plane = -1;
     nuke.nuk_tech = tlev;
     unit_wipe_orders((struct empobj *)&nuke);
 
@@ -769,7 +768,6 @@ build_tower(struct sctstr *sp, short *vec)
     int avail;
     char *p;
     char buf[1024];
-    int good;
     int i;
     int nx;
     int ny;
@@ -828,7 +826,6 @@ build_tower(struct sctstr *sp, short *vec)
 
     /* Now, check.  You aren't allowed to build bridge towers
        next to land. */
-    good = 0;
     for (i = 1; i <= 6; i++) {
        struct sctstr s2;
        nx = sect.sct_x + diroff[i][0];
@@ -836,15 +833,11 @@ build_tower(struct sctstr *sp, short *vec)
        getsect(nx, ny, &s2);
        if ((s2.sct_type != SCT_WATER) &&
            (s2.sct_type != SCT_BTOWER) && (s2.sct_type != SCT_BSPAN)) {
-           good = 1;
-           break;
+           pr("Bridge towers cannot be built adjacent to land.\n");
+           pr("That sector is adjacent to land.\n");
+           return 0;
        }
     }
-    if (good) {
-       pr("Bridge towers cannot be built adjacent to land.\n");
-       pr("That sector is adjacent to land.\n");
-       return 0;
-    }
 
     sp->sct_avail -= avail;
     player->dolcost += buil_tower_bc;