(item_by_name): New, factored out of whatitem(). Use it to simplify

some uses of whatitem().
This commit is contained in:
Markus Armbruster 2004-04-08 19:26:55 +00:00
parent e42f7e8210
commit a8a6f5649f
4 changed files with 34 additions and 14 deletions

View file

@ -80,10 +80,10 @@ tend(void)
if (!strncmp(p, "land", 4))
type = EF_LAND;
else if (NULL != (ip = whatitem(p, (s_char *)0)))
else if (NULL != (ip = item_by_name(p)))
type = EF_SECTOR;
else {
pr("Bad commodity.\n");
pr("Can't tend '%s'\n", p);
return RET_SYN;
}