From c559b207916e63c11751df19969ab8b464641868 Mon Sep 17 00:00:00 2001 From: Ivan Savenko Date: Tue, 11 Feb 2025 20:07:44 +0000 Subject: [PATCH] Add more tracking for crash on Android --- client/battle/CreatureAnimation.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/client/battle/CreatureAnimation.cpp b/client/battle/CreatureAnimation.cpp index 60a59cf54..263ad1ea2 100644 --- a/client/battle/CreatureAnimation.cpp +++ b/client/battle/CreatureAnimation.cpp @@ -200,9 +200,16 @@ CreatureAnimation::CreatureAnimation(const AnimationPath & name_, TSpeedControll speedController(controller), once(false) { + forward = GH.renderHandler().loadAnimation(name_, EImageBlitMode::WITH_SHADOW_AND_SELECTION); reverse = GH.renderHandler().loadAnimation(name_, EImageBlitMode::WITH_SHADOW_AND_SELECTION); + if (forward->size(size_t(ECreatureAnimType::DEATH)) == 0) + throw std::runtime_error("Animation '" + name_.getOriginalName() + "' has empty death animation!"); + + if (forward->size(size_t(ECreatureAnimType::HOLDING)) == 0) + throw std::runtime_error("Animation '" + name_.getOriginalName() + "' has empty holding animation!"); + // if necessary, add one frame into vcmi-only group DEAD if(forward->size(size_t(ECreatureAnimType::DEAD)) == 0) {