Reinstate [race] warnings, stop mapgen from triggering them.
This commit is contained in:
parent
081adc019b
commit
49a7ec6f96
2 changed files with 9 additions and 5 deletions
|
@ -764,9 +764,12 @@ std::string default_generate_map(size_t width, size_t height, size_t island_size
|
|||
LOG_NG << (SDL_GetTicks() - ticks) << "\n"; ticks = SDL_GetTicks();
|
||||
|
||||
config naming = cfg.child_or_empty("naming");
|
||||
// HACK: dummy names to satisfy unit_race requirements
|
||||
naming["id"] = "village_naming";
|
||||
naming["plural_name"] = "villages";
|
||||
|
||||
// Make a dummy race for generating names
|
||||
unit_race name_generator(naming);
|
||||
const unit_race name_generator(naming);
|
||||
|
||||
std::vector<terrain_height_mapper> height_conversion;
|
||||
|
||||
|
@ -1254,6 +1257,9 @@ std::string default_generate_map(size_t width, size_t height, size_t island_size
|
|||
if (nvillages > 0)
|
||||
{
|
||||
config naming_cfg = cfg.child_or_empty("village_naming");
|
||||
// HACK: dummy names to satisfy unit_race requirements
|
||||
naming_cfg["id"] = "village_naming";
|
||||
naming_cfg["plural_name"] = "villages";
|
||||
|
||||
const unit_race village_names_generator(naming_cfg);
|
||||
|
||||
|
|
|
@ -157,14 +157,12 @@ unit_race::unit_race(const config& cfg) :
|
|||
*/
|
||||
if(id_.empty()) {
|
||||
// This code is only for compatibility with old race defs.
|
||||
//lg::wml_error << "[race] '" << cfg["name"] << "' is missing its id, this behaviour is deprecated and will break in 1.7.4\n";
|
||||
// Error message is commented because parts of the engine are using only Markov's chains and not full races.
|
||||
lg::wml_error << "[race] '" << cfg["name"] << "' is missing its id, this behaviour is deprecated and will break in 1.7.4\n";
|
||||
id_ = (cfg["name"]);
|
||||
}
|
||||
if(plural_name_.empty()) {
|
||||
// This code is only for compatibility with old race defs.
|
||||
//lg::wml_error << "[race] '" << cfg["name"] << "' is missing its plural_name, this behaviour is deprecated and will break in 1.7.4\n";
|
||||
// Error message is commented because parts of the engine are using only Markov's chains and not full races.
|
||||
lg::wml_error << "[race] '" << cfg["name"] << "' is missing its plural_name, this behaviour is deprecated and will break in 1.7.4\n";
|
||||
plural_name_ = (cfg["name"]);
|
||||
}
|
||||
// use "name" if "male_name" or "female_name" aren't available
|
||||
|
|
Loading…
Add table
Reference in a new issue