forked from github/server
rmt_find no longer used.
handle old data files with rm_iron, etc.
This commit is contained in:
parent
17145eaf10
commit
0c8a9354db
|
@ -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;
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue