]> git.pond.sub.org Git - empserver/commitdiff
Replace unit_type_name() by empobj_chr_name()
authorMarkus Armbruster <armbru@pond.sub.org>
Mon, 25 Feb 2008 20:18:35 +0000 (21:18 +0100)
committerMarkus Armbruster <armbru@pond.sub.org>
Fri, 14 Mar 2008 19:25:09 +0000 (20:25 +0100)
src/lib/commands/stop.c

index 453fe89155006a47e0703efb24e27175bfdfab27..75f2ed95bcb07705ef4bb8e33dadf382fa4e9906 100644 (file)
@@ -46,7 +46,6 @@ static void start_stop_hdr(int);
 static void proff(int);
 static int start_stop_unit(int, char *, int);
 static void start_stop_unit_hdr(int);
-static char *unit_type_name(union empobj_storage *);
 
 int
 start(void)
@@ -171,7 +170,7 @@ start_stop_unit(int type, char *arg, int off)
            start_stop_unit_hdr(off);
        if (player->god)
            pr("%3d ", unit.gen.own);
-       pr("%4d %-4.4s ", nstr.cur, unit_type_name(&unit));
+       pr("%4d %-4.4s ", nstr.cur, empobj_chr_name(&unit.gen));
        prxy("%4d,%-4d", unit.gen.x, unit.gen.y, player->cnum);
        pr("%4d%%", unit.gen.effic);
        proff(off);
@@ -196,22 +195,3 @@ start_stop_unit_hdr(int off)
        pr("own ");
     pr("   #         x,y     eff\n");
 }
-
-static char *
-unit_type_name(union empobj_storage *unit)
-{
-    int type = unit->gen.type;
-
-    switch (unit->gen.ef_type) {
-    case EF_SHIP:
-       return mchr[type].m_name;
-    case EF_PLANE:
-       return plchr[type].pl_name;
-    case EF_LAND:
-       return lchr[type].l_name;
-    case EF_NUKE:
-       return nchr[type].n_name;
-    }
-    CANT_REACH();
-    return "?";
-}