1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-07-17 01:32:21 +02:00

Added better error reporting for unclear crashes

This commit is contained in:
Ivan Savenko
2025-01-19 12:39:22 +00:00
parent 711bbc684f
commit 82b81a7853
4 changed files with 25 additions and 5 deletions

View File

@ -212,10 +212,17 @@ void CAnimation::createFlippedGroup(const size_t sourceGroup, const size_t targe
ImageLocator CAnimation::getImageLocator(size_t frame, size_t group) const
{
const ImageLocator & locator = source.at(group).at(frame);
try
{
const ImageLocator & locator = source.at(group).at(frame);
if (!locator.empty())
return locator;
if (!locator.empty())
return locator;
}
catch (std::out_of_range &)
{
throw std::runtime_error("Frame " + std::to_string(frame) + " of group " + std::to_string(group) + " is missing from animation " + name.getOriginalName() );
}
return ImageLocator(name, frame, group);
}