@@ -109,7 +109,7 @@ void CUIHudStatesWnd::InitFromXml(CUIXml& xml, LPCSTR path)
109
109
m_ui_weapon_cur_ammo = UIHelper::CreateTextWnd (xml, " static_cur_ammo" , this );
110
110
m_ui_weapon_fmj_ammo = UIHelper::CreateTextWnd (xml, " static_fmj_ammo" , this );
111
111
m_ui_weapon_ap_ammo = UIHelper::CreateTextWnd (xml, " static_ap_ammo" , this );
112
- m_ui_weapon_third_ammo = UIHelper::CreateTextWnd (xml, " static_third_ammo" , this ); // Alundaio: Option to display a third ammo type
112
+ m_ui_weapon_third_ammo = UIHelper::CreateTextWnd (xml, " static_third_ammo" , this , false ); // Alundaio: Option to display a third ammo type
113
113
m_fire_mode = UIHelper::CreateTextWnd (xml, " static_fire_mode" , this );
114
114
m_ui_grenade = UIHelper::CreateTextWnd (xml, " static_grenade" , this );
115
115
@@ -309,7 +309,8 @@ void CUIHudStatesWnd::UpdateActiveItemInfo(CActor* actor)
309
309
m_ui_weapon_cur_ammo->Show (true );
310
310
m_ui_weapon_fmj_ammo->Show (true );
311
311
m_ui_weapon_ap_ammo->Show (true );
312
- m_ui_weapon_third_ammo->Show (true );
312
+ if (m_ui_weapon_third_ammo)
313
+ m_ui_weapon_third_ammo->Show (true );
313
314
314
315
m_fire_mode->Show (true );
315
316
m_ui_grenade->Show (true );
@@ -326,7 +327,8 @@ void CUIHudStatesWnd::UpdateActiveItemInfo(CActor* actor)
326
327
327
328
m_ui_weapon_fmj_ammo->SetTextColor (color_rgba (238 , 155 , 23 , 150 ));
328
329
m_ui_weapon_ap_ammo->SetTextColor (color_rgba (238 , 155 , 23 , 150 ));
329
- m_ui_weapon_third_ammo->SetTextColor (color_rgba (238 , 155 , 23 , 150 ));
330
+ if (m_ui_weapon_third_ammo)
331
+ m_ui_weapon_third_ammo->SetTextColor (color_rgba (238 , 155 , 23 , 150 ));
330
332
331
333
CWeaponMagazinedWGrenade* wpn = smart_cast<CWeaponMagazinedWGrenade*>(item);
332
334
if (wpn && wpn->m_bGrenadeMode )
@@ -341,7 +343,7 @@ void CUIHudStatesWnd::UpdateActiveItemInfo(CActor* actor)
341
343
m_ui_weapon_fmj_ammo->SetTextColor (color_rgba (238 , 155 , 23 , 255 ));
342
344
else if (wpnm->m_ammoType == 1 )
343
345
m_ui_weapon_ap_ammo->SetTextColor (color_rgba (238 , 155 , 23 , 255 ));
344
- else if (wpnm->m_ammoType == 2 )
346
+ else if (wpnm->m_ammoType == 2 && m_ui_weapon_third_ammo )
345
347
m_ui_weapon_third_ammo->SetTextColor (color_rgba (238 , 155 , 23 , 255 ));
346
348
}
347
349
// -Alundaio
@@ -353,7 +355,8 @@ void CUIHudStatesWnd::UpdateActiveItemInfo(CActor* actor)
353
355
m_ui_weapon_cur_ammo->Show (false );
354
356
m_ui_weapon_fmj_ammo->Show (false );
355
357
m_ui_weapon_ap_ammo->Show (false );
356
- m_ui_weapon_third_ammo->Show (false );
358
+ if (m_ui_weapon_third_ammo)
359
+ m_ui_weapon_third_ammo->Show (false );
357
360
m_fire_mode->Show (false );
358
361
m_ui_grenade->Show (false );
359
362
}
0 commit comments