Replace unit_type_name() by empobj_chr_name()

This commit is contained in:
Markus Armbruster 2008-02-25 21:18:35 +01:00
parent 966b881667
commit e38ba07426

View file

@ -46,7 +46,6 @@ static void start_stop_hdr(int);
static void proff(int); static void proff(int);
static int start_stop_unit(int, char *, int); static int start_stop_unit(int, char *, int);
static void start_stop_unit_hdr(int); static void start_stop_unit_hdr(int);
static char *unit_type_name(union empobj_storage *);
int int
start(void) start(void)
@ -171,7 +170,7 @@ start_stop_unit(int type, char *arg, int off)
start_stop_unit_hdr(off); start_stop_unit_hdr(off);
if (player->god) if (player->god)
pr("%3d ", unit.gen.own); 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); prxy("%4d,%-4d", unit.gen.x, unit.gen.y, player->cnum);
pr("%4d%%", unit.gen.effic); pr("%4d%%", unit.gen.effic);
proff(off); proff(off);
@ -196,22 +195,3 @@ start_stop_unit_hdr(int off)
pr("own "); pr("own ");
pr(" # x,y eff\n"); 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 "?";
}