rmt_find no longer used.

handle old data files with rm_iron, etc.
This commit is contained in:
Enno Rehling 2017-03-22 20:46:29 +01:00
parent 17145eaf10
commit 0c8a9354db
3 changed files with 3 additions and 11 deletions

View File

@ -193,16 +193,6 @@ struct rawmaterial *rm_get(region * r, const struct resource_type *rtype)
return rm;
}
struct rawmaterial_type *rmt_find(const char *str)
{
resource_type *rtype = rt_find(str);
if (!rtype && strncmp(str, "rm_", 3) == 0) {
rtype = rt_find(str+3);
}
assert(rtype);
return rtype ? rtype->raw : NULL;
}
struct rawmaterial_type *rmt_get(const struct resource_type *rtype)
{
return rtype->raw;

View File

@ -65,7 +65,6 @@ extern "C" {
void terraform_resources(struct region *r);
struct rawmaterial *rm_get(struct region *,
const struct resource_type *);
struct rawmaterial_type *rmt_find(const char *str);
struct rawmaterial_type *rmt_get(const struct resource_type *);
struct rawmaterial *add_resource(struct region *r, int level,

View File

@ -955,6 +955,9 @@ static region *readregion(struct gamedata *data, int x, int y)
break;
res = malloc(sizeof(rawmaterial));
res->rtype = rt_find(name);
if (!res->rtype && strncmp("rm_", name, 3) == 0) {
res->rtype = rt_find(name + 3);
}
if (!res->rtype || !res->rtype->raw) {
log_error("invalid resourcetype %s in data.", name);
}