]> git.pond.sub.org Git - empserver/commitdiff
Clean up buil()'s variable declarations
authorMarkus Armbruster <armbru@pond.sub.org>
Sat, 23 Apr 2011 08:51:35 +0000 (10:51 +0200)
committerMarkus Armbruster <armbru@pond.sub.org>
Sun, 29 May 2011 13:45:11 +0000 (15:45 +0200)
src/lib/commands/buil.c

index c700c047afe47d1fdf87186049ceca7ff7aaedd3..3db8f913f79cb26ead97354467bce23a01833f6c 100644 (file)
@@ -63,21 +63,15 @@ static int build_can_afford(double, char *);
 int
 buil(void)
 {
+    struct natstr *natp = getnatp(player->cnum);
+    int tlev = (int)natp->nat_level[NAT_TLEV];
     struct sctstr sect;
     struct nstr_sect nstr;
-    struct natstr *natp;
-    int rqtech;
-    int tlev;
-    int type;
+    int rqtech, type, number, val, gotsect;
     char *p, *what, *prompt;
-    int gotsect = 0;
     int (*build_it)(struct sctstr *, int, short[], int);
-    int number, val;
     char buf[1024];
 
-    natp = getnatp(player->cnum);
-    tlev = (int)natp->nat_level[NAT_TLEV];
-
     p = getstarg(player->argp[1],
                 "Build (ship, nuke, bridge, plane, land unit, tower)? ",
                 buf);
@@ -196,6 +190,7 @@ buil(void)
        pr("Building with tech level %d.\n", tlev);
     }
 
+    gotsect = 0;
     while (number-- > 0) {
        while (nxtsct(&nstr, &sect)) {
            gotsect++;