]> git.pond.sub.org Git - empserver/commitdiff
Simplify build_tower() a bit
authorMarkus Armbruster <armbru@pond.sub.org>
Sun, 29 Mar 2009 15:48:06 +0000 (17:48 +0200)
committerMarkus Armbruster <armbru@pond.sub.org>
Tue, 31 Mar 2009 21:03:41 +0000 (23:03 +0200)
No functional change.

src/lib/commands/buil.c

index 83f875965326cecd7c81be2d97f4e6f48f1e0d83..8e298e36c9b8a3c0c22a9ba4976e5cf134a2b4f5 100644 (file)
@@ -769,7 +769,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 +827,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 +834,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;