--- deliantra/server/common/region.C 2010/04/11 00:34:05 1.49 +++ deliantra/server/common/region.C 2010/04/25 10:45:38 1.50 @@ -37,14 +37,6 @@ return regions [0]; } -/* - * Pass a char array, returns a pointer to the region of the same name. - * if it can't find a region of the same name it returns the first region - * with the 'fallback' property set. - * if it can't find a matching name /or/ a fallback region it logs an info message - * message and returns NULL - * used by the map parsing code. - */ region * region::find (shstr_cmp name) { @@ -52,7 +44,19 @@ if (rgn->name == name) return rgn; - LOG (llevError, "region called %s requested, but not found, using fallback.\n", &name); + return default_region (); +} + +region * +region::find (object_thawer &f) +{ + shstr_cmp name = f.get_str (); + + for_all_regions (rgn) + if (rgn->name == name) + return rgn; + + f.parse_error (format ("region called %s requested, but not found, using fallback.\n", f.get_str ())); return default_region (); } @@ -146,7 +150,7 @@ switch (f.kw) { case KW_parent: - rgn->parent = region::find (f.get_str ()); + rgn->parent = region::find (f); break; case KW_msg: f.get_ml (KW_endmsg, rgn->msg); break;