weaponorder[j] = h;
}
-string weaponorder_cmp_str_save;
string weaponorder_cmp_str;
float weaponorder_cmp(float i, float j, entity pass)
{
}
// TODO make this configurable
- weaponorder_cmp_str = strcat(" ", weaponorder_byimpulse, " ");
-
- if(weaponorder_cmp_str != weaponorder_cmp_str_save)
+ if(weaponorder_bypriority != cvar_string("cl_weaponpriority"))
{
- if(weaponorder_cmp_str_save)
- strunzone(weaponorder_cmp_str_save);
- weaponorder_cmp_str_save = strzone(weaponorder_cmp_str);
+ if(weaponorder_bypriority)
+ strunzone(weaponorder_bypriority);
+ if(weaponorder_byimpulse)
+ strunzone(weaponorder_byimpulse);
+
+ weaponorder_bypriority = strzone(cvar_string("cl_weaponpriority"));
+ weaponorder_byimpulse = strzone(W_FixWeaponOrder_BuildImpulseList(W_FixWeaponOrder_ForceComplete(W_NumberWeaponOrder(weaponorder_bypriority))));
+ weaponorder_cmp_str = strcat(" ", weaponorder_byimpulse, " ");
+
weapon_cnt = 0;
for(i = WEP_FIRST; i <= WEP_LAST; ++i)
{
}
}
heapsort(weapon_cnt, weaponorder_swap, weaponorder_cmp, world);
+
+ weaponorder_cmp_str = string_null;
}
HUD_Panel_DrawBg(1);
stuffcmd(self, strcat("cl_cmd sendcvar ", name, "\n"));
}
}
-string W_FixWeaponOrder_ForceComplete(string s);
-string W_FixWeaponOrder_AllowIncomplete(string s);
-string W_FixWeaponOrder_BuildImpulseList(string s);
+float w_getbestweapon(entity e);
string W_FixWeaponOrder_ForceComplete_AndBuildImpulseList(string wo)
{
string o, s;