Skip to content

Commit 7c371fe

Browse files
committed
Set default value for attach_place_idx
1 parent 8670168 commit 7c371fe

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/xrGame/HudItem.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -538,7 +538,7 @@ bool CHudItem::HudAnimationExist(LPCSTR anim_name)
538538
{
539539
string256 anim_name_r;
540540
bool is_16x9 = UI().is_widescreen();
541-
u16 attach_place_idx = pSettings->r_u16(HudItemData()->m_sect_name, "attach_place_idx");
541+
u16 attach_place_idx = READ_IF_EXISTS(pSettings, r_u16, HudItemData()->m_sect_name, "attach_place_idx", 0);
542542
xr_sprintf(anim_name_r, "%s%s", anim_name, ((attach_place_idx == 1) && is_16x9) ? "_16x9" : "");
543543
player_hud_motion* anm = HudItemData()->m_hand_motions.find_motion(anim_name_r);
544544
if (anm)

src/xrGame/player_hud.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -448,7 +448,7 @@ void attachable_hud_item::load(const shared_str& sect_name)
448448
const shared_str& visual_name = pSettings->r_string(sect_name, "item_visual");
449449
m_model = smart_cast<IKinematics*>(::Render->model_Create(visual_name.c_str()));
450450

451-
m_attach_place_idx = pSettings->r_u16(sect_name, "attach_place_idx");
451+
m_attach_place_idx = READ_IF_EXISTS(pSettings, r_u16, sect_name, "attach_place_idx", 0);
452452
m_measures.load (sect_name, m_model);
453453
}
454454

0 commit comments

Comments
 (0)