Skip to content

Commit

Permalink
CharacterPose UI: Tolerate missing anims
Browse files Browse the repository at this point in the history
  • Loading branch information
ohlidalp committed Oct 12, 2022
1 parent b35a908 commit f5bcae9
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion source/main/gui/panels/GUI_CharacterPoseUtil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,17 @@ void CharacterPoseUtil::DrawAnimDbgItemInline(int id, Ogre::Entity* ent)
{
CharacterAnimDbg const& dbg = anim_dbg_states[id];
CharacterAnimDef* def = App::GetGameContext()->GetPlayerCharacter()->getCharacterDocument()->getAnimById(id);
AnimationState* as = ent->getAnimationState(def->anim_name);

AnimationState* as = nullptr;
try
{
as = ent->getAnimationState(def->anim_name);
}
catch (Ogre::ItemIdentityException)
{
ImGui::TextDisabled("ERROR: Animation '%s' does not exist.", def->anim_name.c_str());
return;
}
GUIManager::GuiTheme const& theme = App::GetGuiManager()->GetTheme();

if (dbg.active)
Expand Down

0 comments on commit f5bcae9

Please sign in to comment.