]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/cl_weaponsystem.qc
Merge branch 'master' into mario/monsters
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / cl_weaponsystem.qc
index 311f42fbffea5a8b461b2a81b26b0533387fae3b..0ce872479bf997141c1cfa6dbd9357027d3ec464 100644 (file)
@@ -714,7 +714,6 @@ float client_hasweapon(entity cl, float wpn, float andammo, float complain)
                                if(clienttype(cl) == CLIENTTYPE_REAL)
                                {
                                        play2(cl, "weapons/unavailable.wav");
-                                       sprint(cl, strcat("You don't have any ammo for the ^2", W_Name(wpn), "\n"));
                                        Send_WeaponComplain (cl, wpn, W_Name(wpn), 0);
                                }
                                return FALSE;
@@ -728,8 +727,7 @@ float client_hasweapon(entity cl, float wpn, float andammo, float complain)
                // Report Proper Weapon Status / Modified Weapon Ownership Message
                if (WEPSET_CONTAINS_AW(weaponsInMap, wpn))
                {
-                       sprint(cl, strcat("You do not have the ^2", W_Name(wpn), "\n") );
-                       Send_WeaponComplain (cl, wpn, W_Name(wpn), 1);
+                       Send_WeaponComplain(cl, wpn, W_Name(wpn), 1);
 
                        if(autocvar_g_showweaponspawns)
                        {
@@ -760,7 +758,6 @@ float client_hasweapon(entity cl, float wpn, float andammo, float complain)
                else
                {
                        Send_WeaponComplain (cl, wpn, W_Name(wpn), 2);
-                       sprint(cl, strcat("The ^2", W_Name(wpn), "^7 is ^1NOT AVAILABLE^7 in this map\n") );
                }
 
                play2(cl, "weapons/unavailable.wav");
@@ -823,14 +820,6 @@ void W_SwitchToOtherWeapon(entity pl)
                W_SwitchWeapon_Force(pl, ww);
 }
 
-string PrimaryOrSecondary(float secondary)
-{
-       if(secondary)
-               return "secondary";
-       else
-               return "primary";
-}
-
 .float prevdryfire;
 .float prevwarntime;
 float weapon_prepareattack_checkammo(float secondary)
@@ -854,7 +843,15 @@ float weapon_prepareattack_checkammo(float secondary)
                {
                        if(time - self.prevwarntime > 1)
                        {
-                               sprint(self, strcat("^2", W_Name(self.weapon), " ", PrimaryOrSecondary(secondary), "^7 is unable to fire, but its ^2", PrimaryOrSecondary(1 - secondary), "^7 can.\n"));
+                               Send_Notification(
+                                       NOTIF_ONE,
+                                       self,
+                                       MSG_MULTI,
+                                       ITEM_WEAPON_PRIMORSEC,
+                                       self.weapon,
+                                       secondary,
+                                       (1 - secondary)
+                               );
                        }
                        self.prevwarntime = time;
                }