1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-23 22:37:55 +02:00

Attempt to track crashes with unclear cause

This commit is contained in:
Ivan Savenko
2024-05-14 09:44:40 +00:00
parent c786354af3
commit c92a5bbbab
3 changed files with 35 additions and 31 deletions

View File

@@ -334,8 +334,12 @@ CShowableAnim::CShowableAnim(int x, int y, const AnimationPath & name, ui8 Flags
anim->loadGroup(group);
last = anim->size(group);
pos.w = anim->getImage(0, group)->width();
pos.h = anim->getImage(0, group)->height();
auto image = anim->getImage(0, group);
if (!image)
throw std::runtime_error("Failed to load group " + std::to_string(group) + " of animation file " + name.getOriginalName());
pos.w = image->width();
pos.h = image->height();
pos.x+= x;
pos.y+= y;