diff --git a/src/kernel/resources.c b/src/kernel/resources.c index f40bf0564..8d6e1c2ac 100644 --- a/src/kernel/resources.c +++ b/src/kernel/resources.c @@ -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; diff --git a/src/kernel/resources.h b/src/kernel/resources.h index 3bae0778f..67cd48d43 100644 --- a/src/kernel/resources.h +++ b/src/kernel/resources.h @@ -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, diff --git a/src/kernel/save.c b/src/kernel/save.c index 7237b0e81..105ad7324 100644 --- a/src/kernel/save.c +++ b/src/kernel/save.c @@ -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); }