(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

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