float scoreboard_bottom;
int weapon_accuracy[Weapons_MAX];
-int complain_weapon;
-float complain_weapon_type;
+entity complain_weapon;
+int complain_weapon_type;
float complain_weapon_time;
PlayerScoreField ps_primary, ps_secondary;
}
if(!autocvar_hud_panel_weapons_complainbubble || autocvar__hud_configure || time - complain_weapon_time >= when + fadetime)
- complain_weapon = 0;
+ complain_weapon = NULL;
entity wepent = viewmodels[0]; // TODO: unhardcode
if (autocvar_hud_panel_weapons_onlyowned >= 2) // only current
{
for (i = 0; i <= WEP_LAST-WEP_FIRST; ++i)
- if (weaponorder[i] == panel_switchweapon || weaponorder[i].m_id == complain_weapon)
+ if (weaponorder[i] == panel_switchweapon || weaponorder[i] == complain_weapon)
++weapon_count;
}
else
{
for (i = 0; i <= WEP_LAST-WEP_FIRST; ++i)
- if ((weapons_stat & WepSet_FromWeapon(weaponorder[i])) || weaponorder[i].m_id == complain_weapon)
+ if ((weapons_stat & WepSet_FromWeapon(weaponorder[i])) || weaponorder[i] == complain_weapon)
++weapon_count;
}
{
if (autocvar_hud_panel_weapons_onlyowned >= 2) // only current
{
- if (!(it == panel_switchweapon || it.m_id == complain_weapon))
+ if (!(it == panel_switchweapon || it == complain_weapon))
continue;
}
else
{
- if (!((weapons_stat & WepSet_FromWeapon(it)) || (it.m_id == complain_weapon)))
+ if (!((weapons_stat & WepSet_FromWeapon(it)) || (it == complain_weapon)))
continue;
}
}
}
// draw the complain message
- if(it.m_id == complain_weapon)
+ if(it == complain_weapon)
{
if(fadetime)
a = ((complain_weapon_time + when > time) ? 1 : bound(0, (complain_weapon_time + when + fadetime - time) / fadetime, 1));
NET_HANDLE(TE_CSQC_WEAPONCOMPLAIN, bool isNew)
{
- complain_weapon = ReadByte();
+ int weapon_id = ReadByte();
+ complain_weapon = Weapons_from(weapon_id);
complain_weapon_type = ReadByte();
return = true;
switch(complain_weapon_type)
{
- case 0: Local_Notification(MSG_MULTI, ITEM_WEAPON_NOAMMO, complain_weapon); break;
- case 1: Local_Notification(MSG_MULTI, ITEM_WEAPON_DONTHAVE, complain_weapon); break;
- default: Local_Notification(MSG_MULTI, ITEM_WEAPON_UNAVAILABLE, complain_weapon); break;
+ case 0: Local_Notification(MSG_MULTI, ITEM_WEAPON_NOAMMO, weapon_id); break;
+ case 1: Local_Notification(MSG_MULTI, ITEM_WEAPON_DONTHAVE, weapon_id); break;
+ default: Local_Notification(MSG_MULTI, ITEM_WEAPON_UNAVAILABLE, weapon_id); break;
}
}