mirror of
https://github.com/vcmi/vcmi.git
synced 2024-12-24 22:14:36 +02:00
Ignore corrupted .def files
This commit is contained in:
parent
207968ced3
commit
858ba22a27
@ -204,11 +204,19 @@ void CAnimation::printError(size_t frame, size_t group, std::string type) const
|
||||
|
||||
CAnimation::CAnimation(const AnimationPath & Name):
|
||||
name(boost::starts_with(Name.getName(), "SPRITES") ? Name : Name.addPrefix("SPRITES/")),
|
||||
preloaded(false),
|
||||
defFile()
|
||||
preloaded(false)
|
||||
{
|
||||
if(CResourceHandler::get()->existsResource(name))
|
||||
defFile = std::make_shared<CDefFile>(name);
|
||||
{
|
||||
try
|
||||
{
|
||||
defFile = std::make_shared<CDefFile>(name);
|
||||
}
|
||||
catch ( const std::runtime_error & e)
|
||||
{
|
||||
logAnim->error("Def file %s failed to load! Reason: %s", Name.getOriginalName(), e.what());
|
||||
}
|
||||
}
|
||||
|
||||
init();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user