]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Begin fixing ammo field usage
authorSamual Lenks <samual@xonotic.org>
Tue, 10 Dec 2013 01:32:52 +0000 (20:32 -0500)
committerSamual Lenks <samual@xonotic.org>
Tue, 10 Dec 2013 01:32:52 +0000 (20:32 -0500)
22 files changed:
qcsrc/common/weapons/w_arc.qc
qcsrc/common/weapons/w_blaster.qc
qcsrc/common/weapons/w_crylink.qc
qcsrc/common/weapons/w_devastator.qc
qcsrc/common/weapons/w_electro.qc
qcsrc/common/weapons/w_fireball.qc
qcsrc/common/weapons/w_hagar.qc
qcsrc/common/weapons/w_hlac.qc
qcsrc/common/weapons/w_hook.qc
qcsrc/common/weapons/w_machinegun.qc
qcsrc/common/weapons/w_minelayer.qc
qcsrc/common/weapons/w_minstanex.qc
qcsrc/common/weapons/w_mortar.qc
qcsrc/common/weapons/w_nex.qc
qcsrc/common/weapons/w_porto.qc
qcsrc/common/weapons/w_rifle.qc
qcsrc/common/weapons/w_seeker.qc
qcsrc/common/weapons/w_shockwave.qc
qcsrc/common/weapons/w_tuba.qc
qcsrc/common/weapons/weapons.qc
qcsrc/common/weapons/weapons.qh
qcsrc/server/defs.qh

index 6ce4a90d0b0fbf0429e57b15377522ae4bdcf53f..18b1ba56753e51f75765a7ef8ea3785a5bdd0b94 100644 (file)
@@ -2,7 +2,7 @@
 REGISTER_WEAPON(
 /* WEP_##id */ ARC,
 /* function */ w_arc,
-/* ammotype */ IT_CELLS,
+/* ammotype */ ammo_cells,
 /* impulse  */ 5,
 /* flags    */ WEP_FLAG_NORMAL,
 /* rating   */ BOT_PICKUP_RATING_HIGH,
index 24cc175d8170af2305062338a63585ea503345f1..96bc865bcb97167ba807934cf61bc22876da69f3 100644 (file)
@@ -2,7 +2,7 @@
 REGISTER_WEAPON(
 /* WEP_##id */ BLASTER,
 /* function */ W_Blaster,
-/* ammotype */ 0,
+/* ammotype */ ammo_none,
 /* impulse  */ 1,
 /* flags    */ WEP_FLAG_NORMAL | WEP_FLAG_RELOADABLE | WEP_FLAG_CANCLIMB | WEP_TYPE_SPLASH,
 /* rating   */ 0,
index 8d25c6b7e2ba78623c8bafac1bcf9a5da0b27c0a..df9b1f92266aa4917ad8a0de234a4dd0f0a78bb0 100644 (file)
@@ -2,7 +2,7 @@
 REGISTER_WEAPON(
 /* WEP_##id */ CRYLINK,
 /* function */ w_crylink,
-/* ammotype */ IT_CELLS,
+/* ammotype */ ammo_cells,
 /* impulse  */ 6,
 /* flags    */ WEP_FLAG_NORMAL | WEP_FLAG_RELOADABLE | WEP_TYPE_SPLASH,
 /* rating   */ BOT_PICKUP_RATING_MID,
index 43e5359acf795d940be33eab0f9316372f7ed6cc..3744ff81a877f3c592b4cc1eb3e6b77fa6918a3f 100644 (file)
@@ -2,7 +2,7 @@
 REGISTER_WEAPON(
 /* WEP_##id */ DEVASTATOR,
 /* function */ W_Devastator,
-/* ammotype */ IT_ROCKETS,
+/* ammotype */ ammo_rockets,
 /* impulse  */ 9,
 /* flags    */ WEP_FLAG_NORMAL | WEP_FLAG_RELOADABLE | WEP_FLAG_CANCLIMB | WEP_TYPE_SPLASH,
 /* rating   */ BOT_PICKUP_RATING_HIGH,
index 47bffb0af4e4d811477301ff61ae44c7d396ede7..53fb053a8deed280833722ff02ac2ee090b0c4fb 100644 (file)
@@ -2,7 +2,7 @@
 REGISTER_WEAPON(
 /* WEP_##id */ ELECTRO,
 /* function */ W_Electro,
-/* ammotype */ IT_CELLS,
+/* ammotype */ ammo_cells,
 /* impulse  */ 5,
 /* flags    */ WEP_FLAG_NORMAL | WEP_FLAG_RELOADABLE | WEP_TYPE_SPLASH,
 /* rating   */ BOT_PICKUP_RATING_MID,
index 83b69a7008d82f0a68977522f01bbab691dd7335..d27d565b7e5d8488fa6b632e97a3ed565aa7a595 100644 (file)
@@ -2,7 +2,7 @@
 REGISTER_WEAPON(
 /* WEP_##id */ FIREBALL,
 /* function */ w_fireball,
-/* ammotype */ 0,
+/* ammotype */ ammo_none, // WEAPONTODO
 /* impulse  */ 9,
 /* flags    */ WEP_FLAG_SUPERWEAPON | WEP_TYPE_SPLASH,
 /* rating   */ BOT_PICKUP_RATING_MID,
index 02554970cf3138e4cd502e07a5117b5ace0bb4d7..20e7b7b90ba346aec13c8e6847b626a4f26fed8c 100644 (file)
@@ -2,7 +2,7 @@
 REGISTER_WEAPON(
 /* WEP_##id */ HAGAR,
 /* function */ w_hagar,
-/* ammotype */ IT_ROCKETS,
+/* ammotype */ ammo_rockets,
 /* impulse  */ 8,
 /* flags    */ WEP_FLAG_NORMAL | WEP_FLAG_RELOADABLE | WEP_FLAG_CANCLIMB | WEP_TYPE_SPLASH,
 /* rating   */ BOT_PICKUP_RATING_MID,
index 509a0eabbfa230350ee0da60a9ef9f11bdf24d24..d4e4b3136d2de340f122477f297eed0ce0250cec 100644 (file)
@@ -2,7 +2,7 @@
 REGISTER_WEAPON(
 /* WEP_##id */ HLAC,
 /* function */ w_hlac,
-/* ammotype */ IT_CELLS,
+/* ammotype */ ammo_cells,
 /* impulse  */ 6,
 /* flags    */ WEP_FLAG_MUTATORBLOCKED | WEP_FLAG_RELOADABLE | WEP_TYPE_SPLASH,
 /* rating   */ BOT_PICKUP_RATING_MID,
index 3deabd127ff64afe9df431eacf89a7c836a1f8a3..8a5cc0531499b75aa25dd4e477a3aa13238f042e 100644 (file)
@@ -2,7 +2,7 @@
 REGISTER_WEAPON(
 /* WEP_##id */ HOOK,
 /* function */ w_hook,
-/* ammotype */ IT_CELLS|IT_FUEL,
+/* ammotype */ ammo_fuel,
 /* impulse  */ 0,
 /* flags    */ WEP_FLAG_CANCLIMB | WEP_TYPE_SPLASH,
 /* rating   */ 0,
index a8e5a756b247dd3970acc1ed77be28bcf3d33bba..57924a1c29a21876c2e5d03e7615ad80f763124b 100644 (file)
@@ -2,7 +2,7 @@
 REGISTER_WEAPON(
 /* WEP_##id */ UZI,
 /* function */ w_uzi,
-/* ammotype */ IT_NAILS,
+/* ammotype */ ammo_nails,
 /* impulse  */ 3,
 /* flags    */ WEP_FLAG_NORMAL | WEP_FLAG_RELOADABLE | WEP_TYPE_HITSCAN,
 /* rating   */ BOT_PICKUP_RATING_MID,
index 49d2605b428c5c6c48859e7898491be2e4ad5ef8..4e1092eed9cf1a639c9938c735ea7fccbdf73d5c 100644 (file)
@@ -2,7 +2,7 @@
 REGISTER_WEAPON(
 /* WEP_##id */ MINE_LAYER,
 /* function */ w_minelayer,
-/* ammotype */ IT_ROCKETS,
+/* ammotype */ ammo_rockets,
 /* impulse  */ 4,
 /* flags    */ WEP_FLAG_MUTATORBLOCKED | WEP_FLAG_RELOADABLE | WEP_TYPE_SPLASH,
 /* rating   */ BOT_PICKUP_RATING_HIGH,
index 46f84d258cf2226220567b5a1a3572732c354035..433a5ee81ff3a6f4fb4a1d35829585cc9449f7ca 100644 (file)
@@ -2,7 +2,7 @@
 REGISTER_WEAPON(
 /* WEP_##id */ MINSTANEX,
 /* function */ w_minstanex,
-/* ammotype */ IT_CELLS,
+/* ammotype */ ammo_cells,
 /* impulse  */ 7,
 /* flags    */ WEP_FLAG_RELOADABLE | WEP_FLAG_CANCLIMB | WEP_FLAG_SUPERWEAPON | WEP_TYPE_HITSCAN,
 /* rating   */ BOT_PICKUP_RATING_HIGH,
index 3ac46814c5677e8d8f25ab831e57f7d83f40bb69..588d4994beffb1c708287d12f35c34d096fedeb8 100644 (file)
@@ -2,7 +2,7 @@
 REGISTER_WEAPON(
 /* WEP_##id */ MORTAR,
 /* function */ w_glauncher,
-/* ammotype */ IT_ROCKETS,
+/* ammotype */ ammo_rockets,
 /* impulse  */ 4,
 /* flags    */ WEP_FLAG_NORMAL | WEP_FLAG_RELOADABLE | WEP_FLAG_CANCLIMB | WEP_TYPE_SPLASH,
 /* rating   */ BOT_PICKUP_RATING_MID,
index 0cfa1f2472d5f7daff721401efb1b965276fa0c1..9c0dfbbe8b2b9e41da80c2c54cf848dedd4b4ba3 100644 (file)
@@ -2,7 +2,7 @@
 REGISTER_WEAPON(
 /* WEP_##id */ NEX,
 /* function */ w_nex,
-/* ammotype */ IT_CELLS,
+/* ammotype */ ammo_cells,
 /* impulse  */ 7,
 /* flags    */ WEP_FLAG_NORMAL | WEP_FLAG_RELOADABLE | WEP_TYPE_HITSCAN,
 /* rating   */ BOT_PICKUP_RATING_HIGH,
index b22e5471d20317e5f58ed82fdeb97c080e703683..802dabbb313960fcf523b5d3cf53104a73d7b944 100644 (file)
@@ -2,7 +2,7 @@
 REGISTER_WEAPON(
 /* WEP_##id */ PORTO,
 /* function */ w_porto,
-/* ammotype */ 0,
+/* ammotype */ ammo_none,
 /* impulse  */ 0,
 /* flags    */ WEP_TYPE_OTHER | WEP_FLAG_SUPERWEAPON,
 /* rating   */ 0,
index 4248747687b86da5632869f3e7344786ed4bc806..c37489135e75ce3ed89b8caaf882262e3c2641ef 100644 (file)
@@ -2,7 +2,7 @@
 REGISTER_WEAPON(
 /* WEP_##id */ RIFLE,
 /* function */ w_rifle,
-/* ammotype */ IT_NAILS,
+/* ammotype */ ammo_nails,
 /* impulse  */ 7,
 /* flags    */ WEP_FLAG_MUTATORBLOCKED | WEP_FLAG_NORMAL | WEP_FLAG_RELOADABLE | WEP_TYPE_HITSCAN,
 /* rating   */ BOT_PICKUP_RATING_MID,
index 63385c67a040a9cf4922854a7495845d441acacc..05dc4dd1ea2fb322039e4c8221effaad3b85bb09 100644 (file)
@@ -2,7 +2,7 @@
 REGISTER_WEAPON(
 /* WEP_##id */ SEEKER,
 /* function */ w_seeker,
-/* ammotype */ IT_ROCKETS,
+/* ammotype */ ammo_rockets,
 /* impulse  */ 8,
 /* flags    */ WEP_FLAG_MUTATORBLOCKED | WEP_FLAG_RELOADABLE | WEP_TYPE_SPLASH,
 /* rating   */ BOT_PICKUP_RATING_MID,
index 0f98789cc1cd0832b3421299fe7ff951230977e0..617248eae1c0b73283548a8c958422d65d6c5594 100644 (file)
@@ -2,7 +2,7 @@
 REGISTER_WEAPON(
 /* WEP_##id */ SHOCKWAVE,
 /* function */ W_Shockwave,
-/* ammotype */ IT_SHELLS,
+/* ammotype */ ammo_shells,
 /* impulse  */ 2,
 /* flags    */ WEP_FLAG_NORMAL | WEP_FLAG_RELOADABLE | WEP_TYPE_HITSCAN,
 /* rating   */ BOT_PICKUP_RATING_LOW,
index a68ba575af8dcb450be7b5ad98db70b515796ce1..983b0dec22fac60a9b7aff83723c1948c382b606 100644 (file)
@@ -2,7 +2,7 @@
 REGISTER_WEAPON(
 /* WEP_##id */ TUBA,
 /* function */ w_tuba,
-/* ammotype */ 0,
+/* ammotype */ ammo_none,
 /* impulse  */ 1,
 /* flags    */ WEP_FLAG_HIDDEN | WEP_TYPE_SPLASH,
 /* rating   */ BOT_PICKUP_RATING_MID,
index 2f9dd2c92eb3714beb25cfcb8df950db0ab5cad4..9ec3b7ec0bac0cda0ea2c850350f48440bd6ffaf 100644 (file)
@@ -74,7 +74,7 @@ WepSet ReadWepSet()
 }
 #endif
 
-void register_weapon(float id, WepSet bit, float(float) func, float ammotype, float i, float weapontype, float pickupbasevalue, string modelname, string shortname, string wname)
+void register_weapon(float id, WepSet bit, float(float) func, .float ammotype, float i, float weapontype, float pickupbasevalue, string modelname, string shortname, string wname)
 {
        entity e;
        weapon_info[id - 1] = e = spawn();
@@ -83,7 +83,7 @@ void register_weapon(float id, WepSet bit, float(float) func, float ammotype, fl
        e.weapons = bit;
        e.netname = shortname;
        e.message = wname;
-       e.items = ammotype;
+       //e.items = ammotype;
        e.weapon_func = func;
        e.mdl = modelname;
        e.model = strzone(strcat("models/weapons/g_", modelname, ".md3"));
@@ -91,18 +91,7 @@ void register_weapon(float id, WepSet bit, float(float) func, float ammotype, fl
        e.model2 = strzone(strcat("wpn-", e.mdl));
        e.impulse = i;
        e.bot_pickupbasevalue = pickupbasevalue;
-       if(ammotype & IT_SHELLS)
-               e.ammo_field = ammo_shells;
-       else if(ammotype & IT_NAILS)
-               e.ammo_field = ammo_nails;
-       else if(ammotype & IT_ROCKETS)
-               e.ammo_field = ammo_rockets;
-       else if(ammotype & IT_CELLS)
-               e.ammo_field = ammo_cells;
-       else if(ammotype & IT_FUEL)
-               e.ammo_field = ammo_fuel;
-       else
-               e.ammo_field = ammo_batteries;
+       e.current_ammo = ammotype;
 
        #ifndef MENUQC
        func(WR_INIT);
@@ -120,7 +109,7 @@ void register_weapons_done()
        dummy_weapon_info.weapons = '0 0 0';
        dummy_weapon_info.netname = "";
        dummy_weapon_info.message = "AOL CD Thrower";
-       dummy_weapon_info.items = 0;
+       //dummy_weapon_info.items = 0;
        dummy_weapon_info.weapon_func = w_null;
        dummy_weapon_info.mdl = "";
        dummy_weapon_info.model = "";
@@ -128,6 +117,7 @@ void register_weapons_done()
        dummy_weapon_info.model2 = "";
        dummy_weapon_info.impulse = -1;
        dummy_weapon_info.bot_pickupbasevalue = 0;
+       dummy_weapon_info.current_ammo = ammo_broken;
 
        float i;
        weaponorder_byid = "";
@@ -256,5 +246,5 @@ string W_Name(float weaponid)
 
 float W_AmmoItemCode(float wpn)
 {
-       return (get_weaponinfo(wpn)).items & IT_AMMO;
+       return (get_weaponinfo(wpn)).items & IT_AMMO; // WEAPONTODO
 }
index bf768411c9045edb3009d5ecfe8a74845cec3932..3ff5b6225ab4ec5834d6486e2bc8cf0b6688c6cc 100644 (file)
@@ -122,7 +122,8 @@ float W_AmmoItemCode(float wpn);
 .float ammo_rockets;
 .float ammo_cells;
 .float ammo_fuel;
-.float ammo_batteries; // dummy
+.float ammo_none;
+.float ammo_broken; // dummy
 
 // entity properties of weaponinfo:
 .float weapon; // WEP_...
@@ -137,7 +138,7 @@ float W_AmmoItemCode(float wpn);
 .float impulse; // weapon impulse
 .float bot_pickupbasevalue; // bot weapon priority
 .string model2; // wpn- sprite name
-..float ammo_field; // main ammo field
+..float current_ammo; // main ammo field
 
 // other useful macros
 #define WEP_ACTION(wpn,wrequest) (get_weaponinfo(wpn)).weapon_func(wrequest)
@@ -172,7 +173,7 @@ float W_AmmoItemCode(float wpn);
 #define WEP_SET_PROP(wepid,wepname,type,prop,name) get_weaponinfo(WEP_##wepid).##prop = autocvar_g_balance_##wepname##_##name;
 
 float w_null(float dummy);
-void register_weapon(float id, WepSet bit, float(float) func, float ammotype, float i, float weapontype, float pickupbasevalue, string modelname, string shortname, string wname);
+void register_weapon(float id, WepSet bit, float(float) func, .float ammotype, float i, float weapontype, float pickupbasevalue, string modelname, string shortname, string wname);
 void register_weapons_done();
 
 // note: the fabs call is just there to hide "if result is constant" warning
index 0ebc93756bc0c2b82e3d5bd8da5f5f2bf8adbd6e..bf8456e92340c91452a845cb45c9e4b9f24626ef 100644 (file)
@@ -526,8 +526,6 @@ float client_cefc_accumulator;
 float client_cefc_accumulatortime;
 #endif
 
-..float current_ammo;
-
 .float weapon_load[WEP_MAXCOUNT];
 .float ammo_none; // used by the reloading system, must always be 0
 .float clip_load;