]> git.pond.sub.org Git - empserver/blobdiff - src/lib/commands/buil.c
Update copyright notice.
[empserver] / src / lib / commands / buil.c
index d1495c63f57ed05f349b150c36e2a415ded155b8..4f5e94cd01a4a2ba67d5918a0f6da0b4aafa8a46 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *  Empire - A multi-player, client/server Internet based war game.
- *  Copyright (C) 1986-2006, Dave Pare, Jeff Bailey, Thomas Ruschak,
+ *  Copyright (C) 1986-2007, Dave Pare, Jeff Bailey, Thomas Ruschak,
  *                           Ken Stevens, Steve McClure
  *
  *  This program is free software; you can redistribute it and/or modify
 #include <config.h>
 
 #include <limits.h>
-#include <string.h>
-#include "misc.h"
-#include "player.h"
-#include "plague.h"
-#include "sect.h"
-#include "nat.h"
-#include "ship.h"
+#include "commands.h"
 #include "land.h"
+#include "lost.h"
+#include "map.h"
 #include "nuke.h"
+#include "optlist.h"
+#include "path.h"
+#include "plague.h"
 #include "plane.h"
-#include "xy.h"
-#include "nsc.h"
+#include "ship.h"
 #include "treaty.h"
-#include "file.h"
-#include "path.h"
-#include "optlist.h"
-#include "commands.h"
 
 static int build_nuke(struct sctstr *sp,
                      struct nchrstr *np, short *vec, int tlev);
@@ -109,7 +103,7 @@ buil(void)
        p = getstarg(player->argp[3], "Plane type? ", buf);
        if (p == 0 || *p == 0)
            return RET_SYN;
-       type = typematch(p, EF_PLANE);
+       type = ef_elt_byname(EF_PLANE_CHR, p);
        if (type >= 0) {
            pp = &plchr[type];
            rqtech = pp->pl_tech;
@@ -127,7 +121,7 @@ buil(void)
        p = getstarg(player->argp[3], "Ship type? ", buf);
        if (p == 0 || *p == 0)
            return RET_SYN;
-       type = typematch(p, EF_SHIP);
+       type = ef_elt_byname(EF_SHIP_CHR, p);
        if (type >= 0) {
            mp = &mchr[type];
            rqtech = mp->m_tech;
@@ -147,7 +141,7 @@ buil(void)
        p = getstarg(player->argp[3], "Land unit type? ", buf);
        if (p == 0 || *p == 0)
            return RET_SYN;
-       type = typematch(p, EF_LAND);
+       type = ef_elt_byname(EF_LAND_CHR, p);
        if (type >= 0) {
            lp = &lchr[type];
            rqtech = lp->l_tech;
@@ -188,7 +182,7 @@ buil(void)
        p = getstarg(player->argp[3], "Nuke type? ", buf);
        if (p == 0 || *p == 0)
            return RET_SYN;
-       type = typematch(p, EF_NUKE);
+       type = ef_elt_byname(EF_NUKE_CHR, p);
        if (type >= 0) {
            np = &nchr[type];
            rqtech = np->n_tech;
@@ -693,7 +687,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_stockpile = ' ';
+    nuke.nuk_stockpile = 0;
     nuke.nuk_ship = nuke.nuk_plane = nuke.nuk_land = -1;
     nuke.nuk_uid = nstr.cur;
     nuke.nuk_tech = tlev;