]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Use macro for WEP_NAME as well (get rid of W_Name)
authorSamual Lenks <samual@xonotic.org>
Thu, 2 Jan 2014 00:51:50 +0000 (19:51 -0500)
committerSamual Lenks <samual@xonotic.org>
Thu, 2 Jan 2014 00:51:50 +0000 (19:51 -0500)
qcsrc/client/Main.qc
qcsrc/common/notifications.qh
qcsrc/common/weapons/config.qc
qcsrc/common/weapons/weapons.qc
qcsrc/common/weapons/weapons.qh
qcsrc/server/bot/aim.qc
qcsrc/server/defs.qh
qcsrc/server/miscfunctions.qc
qcsrc/server/weapons/weaponsystem.qc

index 7af87c00d84f2139641bf08c4b078e242e32c007..3fc1ffe540940ba8da2491bb7ee05e1a49e0d17d 100644 (file)
@@ -1168,7 +1168,7 @@ void Net_WeaponComplain()
 
        if(complain_weapon_name)
                strunzone(complain_weapon_name);
-       complain_weapon_name = strzone(W_Name(complain_weapon));
+       complain_weapon_name = strzone(WEP_NAME(complain_weapon));
 
        complain_weapon_type = ReadByte();
 
index 7beb03d84f5aaf87a70fdff012c0fb7ef3e6acd8..f9a69ee88517be61fe29eaa1fc745178f69ddc5a 100644 (file)
@@ -965,7 +965,7 @@ string arg_slot[NOTIF_MAX_ARGS];
     ARG_CASE(ARG_CS_SV,     "spree_inf",     (autocvar_notification_show_sprees ? notif_arg_spree_inf(1, input, s2, f2) : "")) \
     ARG_CASE(ARG_CS_SV,     "spree_end",     (autocvar_notification_show_sprees ? notif_arg_spree_inf(-1, "", "", f1) : "")) \
     ARG_CASE(ARG_CS_SV,     "spree_lost",    (autocvar_notification_show_sprees ? notif_arg_spree_inf(-2, "", "", f1) : "")) \
-    ARG_CASE(ARG_CS_SV,     "item_wepname",  W_Name(f1)) \
+    ARG_CASE(ARG_CS_SV,     "item_wepname",  WEP_NAME(f1)) \
     ARG_CASE(ARG_CS_SV,     "item_wepammo",  (s1 != "" ? sprintf(_(" with %s"), s1) : "")) \
     ARG_CASE(ARG_DC,        "item_centime",  ftos(autocvar_notification_item_centerprinttime)) \
     ARG_CASE(ARG_SV,        "death_team",    Team_ColoredFullName(f1)) \
index d447b182596a3aad2aba692b5021b4d31991e689..2537022f6ac55bba9cff6d12570e68ea0f12b3f9 100644 (file)
@@ -34,14 +34,14 @@ void Dump_Weapon_Settings(void)
                WEP_CONFIG_WRITETOFILE(sprintf(
                        "// {{{ #%d: %s%s\n",
                        i,
-                       W_Name(i),
+                       WEP_NAME(i),
                        (((get_weaponinfo(i)).spawnflags & WEP_FLAG_MUTATORBLOCKED) ? " (MUTATOR WEAPON)" : "")
                ))
                for(x = 0; x <= WEP_CONFIG_COUNT; ++x) { WEP_CONFIG_WRITETOFILE(wep_config_queue[x]) }
                WEP_CONFIG_WRITETOFILE("// }}}\n")
 
                // step 5: debug info
-               print(sprintf("#%d: %s: %d settings...\n", i, W_Name(i), WEP_CONFIG_COUNT));
+               print(sprintf("#%d: %s: %d settings...\n", i, WEP_NAME(i), WEP_CONFIG_COUNT));
                totalsettings += WEP_CONFIG_COUNT;
        }
 
index a5134d7b52a62f4243693e2df9588a5c1e0f3b32..baf6adb617dbcac3c52cfa669d09d391bdd4c0a5 100644 (file)
@@ -249,11 +249,6 @@ void W_RandomWeapons(entity e, float n)
        e.weapons = result;
 }
 
-string W_Name(float weaponid) // WEAPONTODO: make into a macro
-{
-       return (get_weaponinfo(weaponid)).message;
-}
-
 #ifdef CSQC
 .float GetAmmoFieldFromNum(float i)
 {
index 3f45eb5a94a2f359f505f0cd9004461e8a433166..9694077425929d751c3c3690273762bb289f41cb 100644 (file)
@@ -71,7 +71,6 @@ string W_FixWeaponOrder_BuildImpulseList(string o);
 string W_FixWeaponOrder_AllowIncomplete(string order);
 string W_FixWeaponOrder_ForceComplete(string order);
 void W_RandomWeapons(entity e, float n);
-string W_Name(float weaponid);
 
 #ifdef CSQC
 .float GetAmmoFieldFromNum(float i);
@@ -90,6 +89,7 @@ float GetAmmoStat(.float ammotype);
 // other useful macros
 #define WEP_ACTION(wpn,wrequest) (get_weaponinfo(wpn)).weapon_func(wrequest)
 #define WEP_AMMO(wpn) ((get_weaponinfo(WEP_##wpn)).ammo_field)
+#define WEP_NAME(wpn) ((get_weaponinfo(wpn)).message)
 
 
 // ======================
index 3467e2b395d61c7c1f28357fe0460b0a97011394..14e9177c3bea060114ee8fce88b22ae68c43b01d 100644 (file)
@@ -339,12 +339,12 @@ float bot_aim(float shotspeed, float shotspeedupward, float maxshottime, float a
        shotspeedupward *= g_weaponspeedfactor;
        if (!shotspeed)
        {
-               dprint("bot_aim: WARNING: weapon ", W_Name(self.weapon), " shotspeed is zero!\n");
+               dprint("bot_aim: WARNING: weapon ", WEP_NAME(self.weapon), " shotspeed is zero!\n");
                shotspeed = 1000000;
        }
        if (!maxshottime)
        {
-               dprint("bot_aim: WARNING: weapon ", W_Name(self.weapon), " maxshottime is zero!\n");
+               dprint("bot_aim: WARNING: weapon ", WEP_NAME(self.weapon), " maxshottime is zero!\n");
                maxshottime = 1;
        }
        makevectors(self.v_angle);
index 7634de6490d7a9551735bfbd3eb00468c49b5bbc..b07aec8186502fc645a0c03d9fb81690448f1084 100644 (file)
@@ -286,12 +286,12 @@ string gamemode_name;
 
 float startitem_failed;
 
-string W_Name(float weaponid);
 string W_Apply_Weaponreplace(string in);
 
 void FixIntermissionClient(entity e);
 void FixClientCvars(entity e);
 
+// WEAPONTODO: remove this
 WepSet weaponsInMap;
 
 .float respawn_countdown; // next number to count
index 385e14e7c25d722bf1116f2d305adbf51b3054f8..eb3781647f875036c384aa04c6e9b570f1479fe6 100644 (file)
@@ -353,7 +353,7 @@ string formatmessage(string msg)
                                wep = self.switchweapon;
                        if (!wep)
                                wep = self.cnt;
-                       replacement = W_Name(wep);
+                       replacement = WEP_NAME(wep);
                } else if (escape == "W") {
                        if (self.items & IT_SHELLS) replacement = "shells";
                        else if (self.items & IT_NAILS) replacement = "bullets";
index 9ac6202fdce2991ca60ed2d2cbf3848c7d9ced61..b4c46ca6f01e0df8eb3c578a8d0ad14ea3a13bd1 100644 (file)
@@ -892,7 +892,7 @@ void W_Reload(float sent_ammo_min, string sent_sound)
                if(IS_REAL_CLIENT(self) && self.reload_complain < time)
                {
                        play2(self, "weapons/unavailable.wav");
-                       sprint(self, strcat("You don't have enough ammo to reload the ^2", W_Name(self.weapon), "\n"));
+                       sprint(self, strcat("You don't have enough ammo to reload the ^2", WEP_NAME(self.weapon), "\n"));
                        self.reload_complain = time + 1;
                }
                // switch away if the amount of ammo is not enough to keep using this weapon