-string Buff_UndeprecateName(string buffname)
+string Buff_CompatName(string buffname)
{
switch(buffname)
{
#define BUFF_SPAWNFUNC_Q3COMPAT(o, r)
#endif
-string Buff_UndeprecateName(string buffname);
+string Buff_CompatName(string buffname);
BUFF_SPAWNFUNCS(random, NULL)
/* wepimg */ ATTRIB(OverkillHeavyMachineGun, model2, string, "weaponhmg");
/* refname */ ATTRIB(OverkillHeavyMachineGun, netname, string, "okhmg");
/* wepname */ ATTRIB(OverkillHeavyMachineGun, m_name, string, _("Overkill Heavy Machine Gun"));
+/* legacy */ ATTRIB(OverkillHeavyMachineGun, m_deprecated_netname, string, "hmg");
#define X(BEGIN, P, END, class, prefix) \
BEGIN(class) \
/* wepimg */ ATTRIB(OverkillRocketPropelledChainsaw, model2, string, "weaponrpc");
/* refname */ ATTRIB(OverkillRocketPropelledChainsaw, netname, string, "okrpc");
/* wepname */ ATTRIB(OverkillRocketPropelledChainsaw, m_name, string, _("Overkill Rocket Propelled Chainsaw"));
+/* legacy */ ATTRIB(OverkillRocketPropelledChainsaw, m_deprecated_netname, string, "rpc");
#define X(BEGIN, P, END, class, prefix) \
BEGIN(class) \
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_NameWeaponOrder(string order)
{
return mapPriorityList(order, W_NameWeaponOrder_MapFunc);
string W_NumberWeaponOrder_MapFunc(string s)
{
if (s == "0" || stof(s)) return s;
- s = W_UndeprecateName(s);
- FOREACH(Weapons, it != WEP_Null && it.netname == s, return ftos(i));
+ FOREACH(Weapons, it != WEP_Null && (it.netname == s || it.m_deprecated_netname == s), return ftos(i));
return s;
}
string W_NumberWeaponOrder(string order)
ATTRIB(Weapon, netname, string, "");
/** M: wepname : human readable name */
ATTRIB(Weapon, m_name, string, "AOL CD Thrower");
+ /** M: deprecated refname : old reference name for compatibility with weapons that were renamed */
+ ATTRIB(Weapon, m_deprecated_netname, string, "");
ATTRIB(Weapon, m_pickup, entity);
// functions:
string W_FixWeaponOrder(string order, float complete);
-string W_UndeprecateName(string s);
string W_NameWeaponOrder(string order);
string W_NumberWeaponOrder(string order);
string W_FixWeaponOrder_BuildImpulseList(string o);
/* wepimg */ ATTRIB(Blaster, model2, string, "weaponlaser");
/* refname */ ATTRIB(Blaster, netname, string, "blaster");
/* wepname */ ATTRIB(Blaster, m_name, string, _("Blaster"));
+/* legacy */ ATTRIB(Blaster, m_deprecated_netname, string, "laser");
#define X(BEGIN, P, END, class, prefix) \
BEGIN(class) \
/* wepimg */ ATTRIB(Devastator, model2, string, "weaponrocketlauncher");
/* refname */ ATTRIB(Devastator, netname, string, "devastator");
/* wepname */ ATTRIB(Devastator, m_name, string, _("Devastator"));
+/* legacy */ ATTRIB(Devastator, m_deprecated_netname, string, "rocketlauncher");
#define X(BEGIN, P, END, class, prefix) \
BEGIN(class) \
/* wepimg */ ATTRIB(MachineGun, model2, string, "weaponuzi");
/* refname */ ATTRIB(MachineGun, netname, string, "machinegun");
/* wepname */ ATTRIB(MachineGun, m_name, string, _("MachineGun"));
+/* legacy */ ATTRIB(MachineGun, m_deprecated_netname, string, "uzi");
#define X(BEGIN, P, END, class, prefix) \
BEGIN(class) \
/* wepimg */ ATTRIB(Mortar, model2, string, "weapongrenadelauncher");
/* refname */ ATTRIB(Mortar, netname, string, "mortar");
/* wepname */ ATTRIB(Mortar, m_name, string, _("Mortar"));
+/* legacy */ ATTRIB(Mortar, m_deprecated_netname, string, "grenadelauncher");
#define X(BEGIN, P, END, class, prefix) \
BEGIN(class) \
/* wepimg */ ATTRIB(Vaporizer, model2, string, "weaponminstanex");
/* refname */ ATTRIB(Vaporizer, netname, string, "vaporizer");
/* wepname */ ATTRIB(Vaporizer, m_name, string, _("Vaporizer"));
+/* legacy */ ATTRIB(Vaporizer, m_deprecated_netname, string, "minstanex");
#define X(BEGIN, P, END, class, prefix) \
BEGIN(class) \
/* wepimg */ ATTRIB(Vortex, model2, string, "weaponnex");
/* refname */ ATTRIB(Vortex, netname, string, "vortex");
/* wepname */ ATTRIB(Vortex, m_name, string, _("Vortex"));
+/* legacy */ ATTRIB(Vortex, m_deprecated_netname, string, "nex");
#define X(BEGIN, P, END, class, prefix) \
BEGIN(class) \
{
FOREACH(StatusEffect, it.instanceOfBuff,
{
- string s = Buff_UndeprecateName(argv(j));
+ string s = Buff_CompatName(argv(j));
if(s == it.netname)
{
this.buffdef = it;
}
});
FOREACH(Weapons, it != WEP_Null, {
- string s = W_UndeprecateName(argv(j));
- if(s == it.netname)
+ string s = argv(j);
+ if(s == it.netname || s == it.m_deprecated_netname)
{
STAT(WEAPONS, this) |= (it.m_wepset);
if(this.spawnflags == 0 || this.spawnflags == 2)
n = tokenize_console(this.netname);
for(int j = 0; j < n; ++j)
{
- FOREACH(Weapons, it != WEP_Null && W_UndeprecateName(argv(j)) == it.netname, {
+ string cmd = argv(j);
+ FOREACH(Weapons, it != WEP_Null && (cmd == it.netname || cmd == it.m_deprecated_netname), {
it.wr_init(it);
break;
});
got += GiveResourceValue(e, RES_FUEL, op, val);
break;
default:
- FOREACH(StatusEffect, it.instanceOfBuff && buff_Available(it) && Buff_UndeprecateName(cmd) == it.netname,
+ FOREACH(StatusEffect, it.instanceOfBuff && buff_Available(it) && Buff_CompatName(cmd) == it.netname,
{
got += GiveBuff(e, it, op, val);
break;
});
- FOREACH(Weapons, it != WEP_Null && W_UndeprecateName(cmd) == it.netname, {
+ FOREACH(Weapons, it != WEP_Null && (cmd == it.netname || cmd == it.m_deprecated_netname), {
got += GiveWeapon(e, it.m_id, op, val);
break;
});