entity weaponorder[Weapons_MAX];
void weaponorder_swap(int i, int j, entity pass)
{
- TC(int, i); TC(int, j);
+ TC(int, i); TC(int, j);
entity h = weaponorder[i];
weaponorder[i] = weaponorder[j];
weaponorder[j] = h;
string weaponorder_cmp_str;
int weaponorder_cmp(int i, int j, entity pass)
{
- TC(int, i); TC(int, j);
+ TC(int, i); TC(int, j);
int ai = strstrofs(weaponorder_cmp_str, sprintf(" %d ", weaponorder[i].m_id), 0);
int aj = strstrofs(weaponorder_cmp_str, sprintf(" %d ", weaponorder[j].m_id), 0);
return aj - ai; // the string is in REVERSE order (higher prio at the right is what we want, but higher prio first is the string)
}
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));