Skip to content

Commit

Permalink
Fixed "height > 0" crash in CS (#382)
Browse files Browse the repository at this point in the history
  • Loading branch information
Xottab-DUTY committed Oct 3, 2019
1 parent 37b0ceb commit 2131085
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/xrUICore/ScrollBar/UIScrollBar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,14 @@ bool CUIScrollBar::InitScrollBar(Fvector2 pos, float length, bool bIsHorizontal,
xml_doc.Load(CONFIG_PATH, UI_PATH, UI_PATH_DEFAULT, "scroll_bar.xml");

float height = xml_doc.ReadAttribFlt(profile, 0, (bIsHorizontal) ? "height" : "height_v");
if (height == 0.0f && ShadowOfChernobylMode)
height = xml_doc.ReadAttribFlt(profile, 0, "height");
R_ASSERT(height > 0);
if (height == 0.0f)
{
if (ShadowOfChernobylMode)
height = xml_doc.ReadAttribFlt(profile, 0, "height");
else if (ClearSkyMode)
height = 16;
}
R_ASSERT(height > 0.0f);
m_hold_delay = xml_doc.ReadAttribFlt(profile, 0, "hold_delay", 50.0f);

inherited::SetWndPos(pos);
Expand Down

0 comments on commit 2131085

Please sign in to comment.