]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/weapons/all.qc
Cleanse more of the mutator hooks
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / weapons / all.qc
index 6232db886e7a810c8f72b403803fb5c202563e77..1e1ce3eede1b1b429aae7fbd53e9264eb8dce530 100644 (file)
@@ -35,7 +35,7 @@
     #include <server/autocvars.qh>
     #include <server/constants.qh>
     #include <server/defs.qh>
-    #include "../notifications.qh"
+    #include "../notifications/all.qh"
     #include "../deathtypes/all.qh"
     #include <server/mutators/all.qh>
     #include "../mapinfo.qh"
@@ -134,7 +134,7 @@ 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, LAMBDA(return ftos(i)));
+       FOREACH(Weapons, it != WEP_Null && it.netname == s, return ftos(i));
        return s;
 }
 string W_NumberWeaponOrder(string order)
@@ -181,7 +181,7 @@ string W_FixWeaponOrder_BuildImpulseList(string o)
        return substring(o, 1, -1);
 }
 
-string W_FixWeaponOrder_AllowIncomplete(string order)
+string W_FixWeaponOrder_AllowIncomplete(entity this, string order)
 {
        return W_FixWeaponOrder(order, 0);
 }
@@ -202,10 +202,10 @@ void W_RandomWeapons(entity e, float n)
        for (i = 0; i < n; ++i)
        {
                RandomSelection_Init();
-               FOREACH(Weapons, it != WEP_Null, LAMBDA(
+               FOREACH(Weapons, it != WEP_Null, {
                        if (remaining & (it.m_wepset))
                                RandomSelection_Add(it, 0, string_null, 1, 1);
-               ));
+               });
                Weapon w = RandomSelection_chosen_ent;
                result |= WepSet_FromWeapon(w);
                remaining &= ~WepSet_FromWeapon(w);
@@ -262,7 +262,7 @@ string W_Sound(string w_snd)
        string output = strcat("weapons/", w_snd);
 #ifdef SVQC
                MUTATOR_CALLHOOK(WeaponSound, w_snd, output);
-               return weapon_sound_output;
+               return M_ARGV(1, string);
 #else
                return output;
 #endif
@@ -387,7 +387,7 @@ vector shotorg_adjust_values(vector vecs, bool y_is_right, bool visual, int algn
  *   call again with ""
  *   remove the ent
  */
-void CL_WeaponEntity_SetModel(entity this, string name)
+void CL_WeaponEntity_SetModel(entity this, string name, bool _anim)
 {
        if (name == "")
        {
@@ -425,7 +425,6 @@ void CL_WeaponEntity_SetModel(entity this, string name)
                        if (!this.weaponchild)
                        {
                                this.weaponchild = new(weaponchild);
-                               make_pure(this.weaponchild);
 #ifdef CSQC
                                this.weaponchild.drawmask = MASK_NORMAL;
                                this.weaponchild.renderflags |= RF_VIEWMODEL;
@@ -541,6 +540,7 @@ void CL_WeaponEntity_SetModel(entity this, string name)
 
        // check if an instant weapon switch occurred
        setorigin(this, this.view_ofs);
+       if (!_anim) return;
        // reset animstate now
        this.wframe = WFRAME_IDLE;
        setanim(this, this.anim_idle, true, false, true);