Fix small error in previous commit and...

...restore WML warning about missing png extension
This commit is contained in:
Ali El Gariani 2010-06-27 17:30:48 +00:00
parent c2f75aba4e
commit 1b6fc9391b

View file

@ -326,14 +326,17 @@ bool terrain_builder::rule_valid(const building_rule &rule) const
// but only for filenames not using ".."
bool precached = s.find("..") == std::string::npos;
s = "terrain/" + s;
if(precached) {
//TODO reactivate this (costly) warning
//if precached_file_exists(s+".png")
// lg::wml_error << "Terrain image '" << s << "' misses the '.png' extension\n";
return image::precached_file_exists(s);
} else {
return image::exists(s);
if(image::precached_file_exists(s))
continue;
} else if (image::exists(s)){
continue;
}
if(s.find(".png") == std::string::npos){
lg::wml_error << "Terrain image '" << s << "' misses the '.png' extension\n";
}
return false;
}
}
}