(sate): Use ef_byname_from() for second argument.

This commit is contained in:
Markus Armbruster 2006-04-30 13:10:34 +00:00
parent 8cb55944a3
commit 470cd37056

View file

@ -48,6 +48,7 @@
int int
sate(void) sate(void)
{ {
static int sct_shp_or_lnd[] = { EF_SECTOR, EF_SHIP, EF_LAND, EF_BAD };
double tech; double tech;
int pln_uid; int pln_uid;
struct plnstr plane; struct plnstr plane;
@ -79,17 +80,8 @@ sate(void)
return RET_FAIL; return RET_FAIL;
} }
if (player->argp[2]) { if (player->argp[2]) {
switch (*player->argp[2]) { type = ef_byname_from(player->argp[2], sct_shp_or_lnd);
case 'l': if (type < 0) {
type = EF_LAND;
break;
case 's':
if (*(player->argp[2] + 1) == 'e')
type = EF_SECTOR;
else
type = EF_SHIP;
break;
default:
return RET_SYN; return RET_SYN;
} }
} }