}
return s;
}
+
+string W_UndeprecateName(string s)
+{
+ switch (s)
+ {
+ case "nex": return "vortex";
+ case "rocketlauncher": return "devastator";
+ case "laser": return "blaster";
+ case "minstanex": return "vaporizer";
+ case "grenadelauncher": return "mortar";
+ case "uzi": return "machinegun";
+ case "hmg": return "okhmg";
+ case "rpc": return "okrpc";
+ default: return s;
+ }
+}
+
string W_NumberWeaponOrder_MapFunc(string s)
{
if (s == "0" || stof(s)) return s;
- s = W_UNDEPRECATENAME(s);
+ s = W_UndeprecateName(s);
FOREACH(Weapons, it != WEP_Null && it.netname == s, return ftos(i));
return s;
}
string weaponorder_byid;
// functions:
+string W_UndeprecateName(string s);
#define W_FIXWEAPONORDER(order, complete) fixPriorityList(order, WEP_FIRST, WEP_LAST, WEP_IMPULSE_BEGIN - WEP_FIRST, complete)
-
-#define W_UNDEPRECATENAME(s) \
- (s == "nex" ? "vortex" : \
- s == "rocketlauncher" ? "devastator" : \
- s == "laser" ? "blaster" : \
- s == "minstanex" ? "vaporizer" : \
- s == "grenadelauncher" ? "mortar" : \
- s == "uzi" ? "machinegun" : \
- s == "hmg" ? "okhmg" : \
- s == "rpc" ? "okrpc" : s)
-
string W_NameWeaponOrder_MapFunc(string s);
string W_NumberWeaponOrder_MapFunc(string s);
#define W_NAMEWEAPONORDER(order) mapPriorityList(order, W_NameWeaponOrder_MapFunc)
}
});
FOREACH(Weapons, it != WEP_Null, {
- s = W_UNDEPRECATENAME(s);
+ s = W_UndeprecateName(s);
if(s == it.netname)
{
STAT(WEAPONS, this) |= (it.m_wepset);
for(int j = 0; j < n; ++j)
{
string s = argv(j);
- FOREACH(Weapons, it != WEP_Null && W_UNDEPRECATENAME(s) == it.netname, {
+ FOREACH(Weapons, it != WEP_Null && W_UndeprecateName(s) == it.netname, {
it.wr_init(it);
break;
});
got += GiveBuff(e, it, op, val);
break;
});
- FOREACH(Weapons, it != WEP_Null && W_UNDEPRECATENAME(cmd) == it.netname, {
+ FOREACH(Weapons, it != WEP_Null && W_UndeprecateName(cmd) == it.netname, {
got += GiveWeapon(e, it.m_id, op, val);
break;
});