(arm, tran_nuke): Lookup of the nuke name was broken by nuke.h

rev. 1.10.  Replace by typematch().

(arm): Simplify search for nuke at sector.
This commit is contained in:
Markus Armbruster 2005-11-06 20:01:51 +00:00
parent 19953e6c22
commit 100d0fc495
2 changed files with 14 additions and 28 deletions

View file

@ -75,12 +75,10 @@ static int
tran_nuke(void)
{
struct nchrstr *ncp;
int len;
coord x, y;
coord dstx, dsty;
int found;
s_char *p;
int i;
int nuketype;
int moving;
struct nukstr nuke;
@ -115,16 +113,12 @@ tran_nuke(void)
return RET_SYN;
if (!check_sect_ok(&sect))
return RET_FAIL;
len = strlen(p);
for (i = 0, ncp = nchr; i < N_MAXNUKE; i++, ncp++) {
if (strncmp(ncp->n_name, p, len) == 0)
break;
}
if (i >= N_MAXNUKE) {
nuketype = typematch(p, EF_NUKE);
if (nuketype < 0) {
pr("No such nuke type!\n");
return RET_SYN;
}
nuketype = i;
ncp = &nchr[nuketype];
if (!nuke.nuk_types[nuketype]) {
pr("No %s nukes in %s\n",
ncp->n_name, xyas(sect.sct_x, sect.sct_y, player->cnum));