]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/weapons/selection.qc
Offhand hook: migrate to mutator system
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / weapons / selection.qc
index 9e175aec4daf59180c3e1be7e7d8af0b7ffdeb50..7b5eb25ef45a6a22ac9c2c10c00ef30939c45958 100644 (file)
@@ -24,8 +24,10 @@ float client_hasweapon(entity cl, float wpn, float andammo, float complain)
        if(time < self.hasweapon_complain_spam)
                complain = 0;
 
-       if(wpn == WEP_HOOK.m_id && !g_grappling_hook && autocvar_g_nades && !((cl.weapons | weaponsInMap) & WepSet_FromWeapon(wpn)))
-               complain = 0;
+       // ignore hook button when using nades without hook
+       if (autocvar_g_nades && cl.offhand != OFFHAND_HOOK)
+       if (wpn == WEP_HOOK.m_id && !((cl.weapons | weaponsInMap) & WepSet_FromWeapon(wpn)))
+           complain = 0;
 
        if(complain)
                self.hasweapon_complain_spam = time + 0.2;
@@ -63,7 +65,7 @@ float client_hasweapon(entity cl, float wpn, float andammo, float complain)
                                if (complain)
                                if(IS_REAL_CLIENT(cl))
                                {
-                                       play2(cl, W_Sound("unavailable"));
+                                       play2(cl, SND(UNAVAILABLE));
                                        Send_WeaponComplain (cl, wpn, 0);
                                }
                                return false;
@@ -107,7 +109,7 @@ float client_hasweapon(entity cl, float wpn, float andammo, float complain)
                        Send_WeaponComplain (cl, wpn, 2);
                }
 
-               play2(cl, W_Sound("unavailable"));
+               play2(cl, SND(UNAVAILABLE));
        }
        return false;
 }