]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/cl_weaponsystem.qc
Merge branch 'master' into mario/runematch_nuke
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / cl_weaponsystem.qc
index cf6ebed95b25c831018408933f253cd4f4b0efcf..afabe1820284522acf4d4dc0211d610d277de559 100644 (file)
@@ -699,7 +699,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;
@@ -713,8 +712,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)
                        {
@@ -745,7 +743,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");
@@ -808,14 +805,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)
@@ -839,7 +828,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;
                }