]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Simplify REGISTER_WEAPON, now possible thanks to the new WEP_CVAR* macros
authorterencehill <piuntn@gmail.com>
Mon, 12 Aug 2024 22:59:46 +0000 (00:59 +0200)
committerterencehill <piuntn@gmail.com>
Mon, 12 Aug 2024 22:59:46 +0000 (00:59 +0200)
26 files changed:
qcsrc/common/mutators/mutator/overkill/okhmg.qh
qcsrc/common/mutators/mutator/overkill/okmachinegun.qh
qcsrc/common/mutators/mutator/overkill/oknex.qh
qcsrc/common/mutators/mutator/overkill/okrpc.qh
qcsrc/common/mutators/mutator/overkill/okshotgun.qh
qcsrc/common/weapons/all.qh
qcsrc/common/weapons/weapon/arc.qh
qcsrc/common/weapons/weapon/blaster.qh
qcsrc/common/weapons/weapon/crylink.qh
qcsrc/common/weapons/weapon/devastator.qh
qcsrc/common/weapons/weapon/electro.qh
qcsrc/common/weapons/weapon/fireball.qh
qcsrc/common/weapons/weapon/hagar.qh
qcsrc/common/weapons/weapon/hlac.qh
qcsrc/common/weapons/weapon/hook.qh
qcsrc/common/weapons/weapon/machinegun.qh
qcsrc/common/weapons/weapon/minelayer.qh
qcsrc/common/weapons/weapon/mortar.qh
qcsrc/common/weapons/weapon/porto.qh
qcsrc/common/weapons/weapon/rifle.qh
qcsrc/common/weapons/weapon/seeker.qh
qcsrc/common/weapons/weapon/shockwave.qh
qcsrc/common/weapons/weapon/shotgun.qh
qcsrc/common/weapons/weapon/tuba.qh
qcsrc/common/weapons/weapon/vaporizer.qh
qcsrc/common/weapons/weapon/vortex.qh

index c4e140234c482fc31e09012069b69d8608206570..46dcff4509107e8742f8fded9859c8b57573b7bb 100644 (file)
@@ -59,7 +59,7 @@ CLASS(OverkillHeavyMachineGun, Weapon)
 #undef X
 
 ENDCLASS(OverkillHeavyMachineGun)
-REGISTER_WEAPON(OVERKILL_HMG, okhmg, NEW(OverkillHeavyMachineGun));
+REGISTER_WEAPON(OVERKILL_HMG, NEW(OverkillHeavyMachineGun));
 
 //SPAWNFUNC_WEAPON(weapon_okhmg, WEP_OVERKILL_HMG)
 //SPAWNFUNC_WEAPON(weapon_hmg, WEP_OVERKILL_HMG)
index cd1eac827a1b59f9add89cffc84c89375f5f9ede..13d44033c21c78255628361cac47f9044275d418 100644 (file)
@@ -59,6 +59,6 @@ CLASS(OverkillMachineGun, Weapon)
 #undef X
 
 ENDCLASS(OverkillMachineGun)
-REGISTER_WEAPON(OVERKILL_MACHINEGUN, okmachinegun, NEW(OverkillMachineGun));
+REGISTER_WEAPON(OVERKILL_MACHINEGUN, NEW(OverkillMachineGun));
 
 //SPAWNFUNC_WEAPON(weapon_okmachinegun, WEP_OVERKILL_MACHINEGUN)
index 21bbfaa2f9f069d46554cd196b574b1eb884651a..1890f47fcbae00e657dcd8430b1f26f0951c665f 100644 (file)
@@ -72,7 +72,7 @@ CLASS(OverkillNex, Weapon)
 #undef X
 
 ENDCLASS(OverkillNex)
-REGISTER_WEAPON(OVERKILL_NEX, oknex, NEW(OverkillNex));
+REGISTER_WEAPON(OVERKILL_NEX, NEW(OverkillNex));
 
 
 //SPAWNFUNC_WEAPON(weapon_oknex, WEP_OVERKILL_NEX)
index 28b76348840e84512f75083eb341a5e328ad3b0c..c63db10f7b18b5a24cdfd4caaa16d55c88be87d7 100644 (file)
@@ -64,7 +64,7 @@ CLASS(OverkillRocketPropelledChainsaw, Weapon)
 #undef X
 
 ENDCLASS(OverkillRocketPropelledChainsaw)
-REGISTER_WEAPON(OVERKILL_RPC, okrpc, NEW(OverkillRocketPropelledChainsaw));
+REGISTER_WEAPON(OVERKILL_RPC, NEW(OverkillRocketPropelledChainsaw));
 
 //SPAWNFUNC_WEAPON(weapon_okrpc, WEP_OVERKILL_RPC)
 //SPAWNFUNC_WEAPON(weapon_rpc, WEP_OVERKILL_RPC)
index 91412689b3cbefba3eb4f1144a2f683dad566d07..bf0f8e0f65376c38ad9ebe5ca7800c0ee8bbdac1 100644 (file)
@@ -60,6 +60,6 @@ CLASS(OverkillShotgun, Weapon)
 #undef X
 
 ENDCLASS(OverkillShotgun)
-REGISTER_WEAPON(OVERKILL_SHOTGUN, okshotgun, NEW(OverkillShotgun));
+REGISTER_WEAPON(OVERKILL_SHOTGUN, NEW(OverkillShotgun));
 
 //SPAWNFUNC_WEAPON(weapon_okshotgun, WEP_OVERKILL_SHOTGUN)
index 27a506935c3092cc797475b79c5f2a1caf86de3c..04d658734b1a4f2d53f20fd9fba7d5e3bc7f539a 100644 (file)
@@ -122,13 +122,7 @@ STATIC_INIT_LATE(W_PROP_reloader)
 }
 #endif
 
-#define REGISTER_WEAPON(...) EVAL_REGISTER_WEAPON(OVERLOAD(REGISTER_WEAPON, __VA_ARGS__))
-#define EVAL_REGISTER_WEAPON(...) __VA_ARGS__
-#define REGISTER_WEAPON_2(id, inst) REGISTER(Weapons, WEP, id, m_id, inst)
-/** TODO: deprecated - remove */
-#define REGISTER_WEAPON_3(id, sname, inst) \
-    REGISTER_WEAPON_2(id, inst); \
-    [[alias("WEP_" #id)]] Weapon _wep_##sname
+#define REGISTER_WEAPON(id, inst) REGISTER(Weapons, WEP, id, m_id, inst)
 
 REGISTER_WEAPON(Null, NEW(Weapon));
 REGISTRY_DEFINE_GET(Weapons, WEP_Null)
index 15a2cb772f15b8dde905e6cd6c5d65197d566576..a7d289c079c7cce6484b71e06db3a192801a4c26 100644 (file)
@@ -80,7 +80,7 @@ CLASS(Arc, Weapon)
 #undef X
 
 ENDCLASS(Arc)
-REGISTER_WEAPON(ARC, arc, NEW(Arc));
+REGISTER_WEAPON(ARC, NEW(Arc));
 
 SPAWNFUNC_WEAPON(weapon_arc, WEP_ARC)
 
index 944e86405d595f3882532c0e887ef419e1b308c0..23e147478e43abb4e81cf4a3f7b6587123a1373e 100644 (file)
@@ -46,7 +46,7 @@ CLASS(Blaster, Weapon)
 #undef X
 
 ENDCLASS(Blaster)
-REGISTER_WEAPON(BLASTER, blaster, NEW(Blaster));
+REGISTER_WEAPON(BLASTER, NEW(Blaster));
 
 SPAWNFUNC_WEAPON(weapon_blaster, WEP_BLASTER)
 SPAWNFUNC_WEAPON(weapon_laser, WEP_BLASTER)
index 2329c364e2998f16d425856292da6c6431b181e3..872bbcb1aa723adf63226bf6bc43cd7370c7e0d7 100644 (file)
@@ -60,7 +60,7 @@ CLASS(Crylink, Weapon)
 #undef X
 
 ENDCLASS(Crylink)
-REGISTER_WEAPON(CRYLINK, crylink, NEW(Crylink));
+REGISTER_WEAPON(CRYLINK, NEW(Crylink));
 
 SPAWNFUNC_WEAPON(weapon_crylink, WEP_CRYLINK)
 
index 7a10bf62a17358ff085a8464d70fcdc24f1b7bfb..39fa3761348a6770c4a997db5d4bfe6570cd6fe3 100644 (file)
@@ -65,7 +65,7 @@ CLASS(Devastator, Weapon)
 #undef X
 
 ENDCLASS(Devastator)
-REGISTER_WEAPON(DEVASTATOR, devastator, NEW(Devastator));
+REGISTER_WEAPON(DEVASTATOR, NEW(Devastator));
 
 SPAWNFUNC_WEAPON(weapon_devastator, WEP_DEVASTATOR)
 SPAWNFUNC_WEAPON(weapon_rocketlauncher, WEP_DEVASTATOR)
index e4263403bf82161b52cf66eac3a1507e9f4b3748..fe9199b8f9665fe0bb4c5b96e0491f57fa793b2e 100644 (file)
@@ -73,7 +73,7 @@ CLASS(Electro, Weapon)
 #undef X
 
 ENDCLASS(Electro)
-REGISTER_WEAPON(ELECTRO, electro, NEW(Electro));
+REGISTER_WEAPON(ELECTRO, NEW(Electro));
 
 SPAWNFUNC_WEAPON(weapon_electro, WEP_ELECTRO)
 
index c3dd73a2eb8bab5eea5d70b2288896533bdf9650..3ce41d9325a38fa9509dd400b6223c9a59e706dc 100644 (file)
@@ -54,7 +54,7 @@ CLASS(Fireball, Weapon)
 #undef X
 
 ENDCLASS(Fireball)
-REGISTER_WEAPON(FIREBALL, fireball, NEW(Fireball));
+REGISTER_WEAPON(FIREBALL, NEW(Fireball));
 
 SPAWNFUNC_WEAPON(weapon_fireball, WEP_FIREBALL)
 
index 5a43d84eff1fc5113e56058bc4a687d7fd95d54b..1d5ea28d647aea4fa5514dcbf90b8dfb233f1879 100644 (file)
@@ -58,6 +58,6 @@ CLASS(Hagar, Weapon)
 #undef X
 
 ENDCLASS(Hagar)
-REGISTER_WEAPON(HAGAR, hagar, NEW(Hagar));
+REGISTER_WEAPON(HAGAR, NEW(Hagar));
 
 SPAWNFUNC_WEAPON(weapon_hagar, WEP_HAGAR)
index ec07fa35a4ba76184f9afe38416e5a35cea28301..2d7e655d6c845c1051652465ae16961a3536f88f 100644 (file)
@@ -50,6 +50,6 @@ CLASS(HLAC, Weapon)
 #undef X
 
 ENDCLASS(HLAC)
-REGISTER_WEAPON(HLAC, hlac, NEW(HLAC));
+REGISTER_WEAPON(HLAC, NEW(HLAC));
 
 SPAWNFUNC_WEAPON(weapon_hlac, WEP_HLAC)
index 25b1be5073aa14542acc2e85802320597615c259..0bb7b84e1dfa997fd1add258ef5ca5d25d6c4a92 100644 (file)
@@ -50,7 +50,7 @@ CLASS(Hook, Weapon)
 #undef X
 
 ENDCLASS(Hook)
-REGISTER_WEAPON(HOOK, hook, NEW(Hook));
+REGISTER_WEAPON(HOOK, NEW(Hook));
 
 SPAWNFUNC_WEAPON(weapon_hook, WEP_HOOK)
 
index 1b77baaee4d9374cb8d3543fc4ef0f8162d25cfe..450a12df9472c5e8162bb3fb3fc60859bcac4cd5 100644 (file)
@@ -61,7 +61,7 @@ CLASS(MachineGun, Weapon)
 #undef X
 
 ENDCLASS(MachineGun)
-REGISTER_WEAPON(MACHINEGUN, machinegun, NEW(MachineGun));
+REGISTER_WEAPON(MACHINEGUN, NEW(MachineGun));
 
 SPAWNFUNC_WEAPON(weapon_machinegun, WEP_MACHINEGUN)
 SPAWNFUNC_WEAPON(weapon_uzi, WEP_MACHINEGUN)
index a574510f57736e373e0107ea59202d102ca09fca..1f503f7ff63eabb6483e6b554415f2b1fd75dda5 100644 (file)
@@ -54,7 +54,7 @@ CLASS(MineLayer, Weapon)
     W_PROPS(X, MineLayer, minelayer)
 #undef X
 ENDCLASS(MineLayer)
-REGISTER_WEAPON(MINE_LAYER, minelayer, NEW(MineLayer));
+REGISTER_WEAPON(MINE_LAYER, NEW(MineLayer));
 
 SPAWNFUNC_WEAPON(weapon_minelayer, WEP_MINE_LAYER)
 
index 6d44e75644ca0f2efe5865a2f855d46cec3f2c46..ce333250acc8f65023f01fe918481579db73c393 100644 (file)
@@ -55,7 +55,7 @@ CLASS(Mortar, Weapon)
     W_PROPS(X, Mortar, mortar)
 #undef X
 ENDCLASS(Mortar)
-REGISTER_WEAPON(MORTAR, mortar, NEW(Mortar));
+REGISTER_WEAPON(MORTAR, NEW(Mortar));
 
 SPAWNFUNC_WEAPON(weapon_mortar, WEP_MORTAR)
 SPAWNFUNC_WEAPON(weapon_grenadelauncher, WEP_MORTAR)
index 757386b5c3f9dd65db332d5ed948619f3cc74b12..30d76908b671c4cd693d22cbe45453112e5c02f0 100644 (file)
@@ -34,7 +34,7 @@ CLASS(PortoLaunch, Weapon)
     W_PROPS(X, PortoLaunch, porto)
 #undef X
 ENDCLASS(PortoLaunch)
-REGISTER_WEAPON(PORTO, porto, NEW(PortoLaunch));
+REGISTER_WEAPON(PORTO, NEW(PortoLaunch));
 
 SPAWNFUNC_WEAPON(weapon_porto, WEP_PORTO)
 
index 9b69985a43f347099779a1ee863102caab63187c..56f24b8f0a4b84518f85de0f358dd3b38dd9ada2 100644 (file)
@@ -53,7 +53,7 @@ CLASS(Rifle, Weapon)
        W_PROPS(X, Rifle, rifle)
 #undef X
 ENDCLASS(Rifle)
-REGISTER_WEAPON(RIFLE, rifle, NEW(Rifle));
+REGISTER_WEAPON(RIFLE, NEW(Rifle));
 
 SPAWNFUNC_WEAPON(weapon_rifle, WEP_RIFLE)
 SPAWNFUNC_WEAPON(weapon_campingrifle, WEP_RIFLE)
index d3024a436e485fa5a0bda7557d1489a4ebaca4a8..e62145ac41830305c5f55d17a61995ebfaa2bd58 100644 (file)
@@ -83,7 +83,7 @@ CLASS(Seeker, Weapon)
        W_PROPS(X, Seeker, seeker)
 #undef X
 ENDCLASS(Seeker)
-REGISTER_WEAPON(SEEKER, seeker, NEW(Seeker));
+REGISTER_WEAPON(SEEKER, NEW(Seeker));
 
 SPAWNFUNC_WEAPON(weapon_seeker, WEP_SEEKER)
 
index 9fa484b6a49ea75f22970ed610f7b711b34c2878..76d3c3ef258a567b880ef445e60ba25d2e76c3a9 100644 (file)
@@ -73,7 +73,7 @@ CLASS(Shockwave, Weapon)
 #undef X
 
 ENDCLASS(Shockwave)
-REGISTER_WEAPON(SHOCKWAVE, shockwave, NEW(Shockwave));
+REGISTER_WEAPON(SHOCKWAVE, NEW(Shockwave));
 
 SPAWNFUNC_WEAPON(weapon_shockwave, WEP_SHOCKWAVE)
 
index 8f78e72b630c1c0c3f76fe3850a82cd17992eb29..13cf944c3ba9daccd1eb66960f4b3436609ee7bd 100644 (file)
@@ -60,5 +60,5 @@ CLASS(Shotgun, Weapon)
 #undef X
 
 ENDCLASS(Shotgun)
-REGISTER_WEAPON(SHOTGUN, shotgun, NEW(Shotgun));
+REGISTER_WEAPON(SHOTGUN, NEW(Shotgun));
 
index 8855fc7527d50cc8bb4fa50965b25f1cfd45cdb4..f2a1712c55e9828ccee1ea7e91bb24431767e7f5 100644 (file)
@@ -39,7 +39,7 @@ CLASS(Tuba, Weapon)
     W_PROPS(X, Tuba, tuba)
 #undef X
 ENDCLASS(Tuba)
-REGISTER_WEAPON(TUBA, tuba, NEW(Tuba));
+REGISTER_WEAPON(TUBA, NEW(Tuba));
 
 SPAWNFUNC_WEAPON(weapon_tuba, WEP_TUBA)
 
index 6d582d45b49835aa6d042dce621204bcbc0794bd..2bc58d9931d1f582c60fb84dd38973d2fa328888 100644 (file)
@@ -58,7 +58,7 @@ CLASS(Vaporizer, Weapon)
 #undef X
 
 ENDCLASS(Vaporizer)
-REGISTER_WEAPON(VAPORIZER, vaporizer, NEW(Vaporizer));
+REGISTER_WEAPON(VAPORIZER, NEW(Vaporizer));
 
 SPAWNFUNC_WEAPON(weapon_vaporizer, WEP_VAPORIZER)
 SPAWNFUNC_WEAPON(weapon_minstanex, WEP_VAPORIZER)
index ef88c6bd83405f324fd2b136394320c8a5568a92..b31836e6979fb6e909d8a7e4ee866216d836359a 100644 (file)
@@ -63,7 +63,7 @@ CLASS(Vortex, Weapon)
 #undef X
 
 ENDCLASS(Vortex)
-REGISTER_WEAPON(VORTEX, vortex, NEW(Vortex));
+REGISTER_WEAPON(VORTEX, NEW(Vortex));
 
 SPAWNFUNC_WEAPON(weapon_vortex, WEP_VORTEX)
 SPAWNFUNC_WEAPON(weapon_nex, WEP_VORTEX)