Skip to content

Commit

Permalink
Fix crash when condition tag is missing
Browse files Browse the repository at this point in the history
  • Loading branch information
Drombeys committed Sep 24, 2024
1 parent d855f8e commit 2fbfb93
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions src/xrGame/ui/ui_af_params.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,16 @@ void CUIArtefactParams::InitFromXml( CUIXml& xml )
m_Prop_line->SetAutoDelete( false );
CUIXmlInit::InitStatic( xml, "prop_line", 0, m_Prop_line );

m_disp_condition = new UIArtefactParamItem();
m_disp_condition->Init(xml, "condition");
m_disp_condition->SetAutoDelete(false);
LPCSTR name = g_pStringTable->translate("st_condition").c_str();
m_disp_condition->SetCaption(name);
xml.SetLocalRoot(base_node);
const static bool enableArtDegradation = EngineExternal()[EEngineExternalGame::EnableArtefactDegradation];
if (enableArtDegradation)
{
m_disp_condition = new UIArtefactParamItem();
m_disp_condition->Init(xml, "condition");
m_disp_condition->SetAutoDelete(false);
LPCSTR name = g_pStringTable->translate("st_condition").c_str();
m_disp_condition->SetCaption(name);
xml.SetLocalRoot(base_node);
}

for ( u32 i = 0; i < ALife::infl_max_count; ++i )
{
Expand Down

0 comments on commit 2fbfb93

Please sign in to comment.