(ef_byname_from): New.

(set, mission, multifire, fuel, cons_choose, cede): Use it instead of
ef_byname().  Remove the hacks to map unwanted results to wanted
results.  The hacks in set() were broken: bad input made the code cast
arbitrary items to union trdgenstr, with potentially disastrous
consequences.  Closes #906483 and #906486.

(set): Less cryptic prompt and diagnostics.
This commit is contained in:
Markus Armbruster 2005-10-27 21:33:17 +00:00
parent 2df98825e9
commit 2fc1e74a72
8 changed files with 54 additions and 30 deletions

View file

@ -86,6 +86,7 @@ static void use_ammo(struct emp_qelem *);
int
multifire(void)
{
static int ef_with_guns[] = { EF_SECTOR, EF_SHIP, EF_LAND, EF_BAD };
s_char vbuf[20];
s_char *ptr;
double range2, range;
@ -132,7 +133,7 @@ multifire(void)
buf)))
return RET_SYN;
player->argp[1] = 0;
type = ef_byname(p);
type = ef_byname_from(p, ef_with_guns);
if (type == EF_SECTOR) {
if (opt_NO_FORT_FIRE) {
pr("Fort firing is disabled.\n");