]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/weapons/all.qh
Weapons: remove redundancies
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / weapons / all.qh
index 7972e7f0f2c90906d1ca09bd296d4c90a61c34e5..929564c3ef8504efa2f77a5b1916da72109a4829 100644 (file)
@@ -129,6 +129,11 @@ STATIC_INIT_LATE(W_PROP_reloader)
 
 REGISTER_WEAPON(Null, NEW(Weapon));
 
+Weapon Weapons_fromstr(string s)
+{
+    FOREACH(Weapons, it != WEP_Null && it.netname == s, return it);
+    return NULL;
+}
 
 
 // legacy w_prop mappings
@@ -300,7 +305,6 @@ STATIC_INIT(register_weapons_done)
         WepSet set = it.m_wepset;
         WEPSET_ALL |= set;
         if ((it.spawnflags) & WEP_FLAG_SUPERWEAPON) WEPSET_SUPERWEAPONS |= set;
-        it.weapon = it.m_id;
         it.weapons = set;
         if (it == WEP_Null) continue;
         int imp = WEP_IMPULSE_BEGIN + it.m_id - 1;
@@ -326,10 +330,6 @@ STATIC_INIT(register_weapons_done)
 .vector weaponentity_glowmod;
 
 //.int weapon; // current weapon
-#ifdef SVQC
-.int switchweapon = _STAT(SWITCHWEAPON);
-.int switchingweapon = _STAT(SWITCHINGWEAPON);
-#endif
 .string weaponname; // name of .weapon
 
 .vector spawnorigin; // for casings