]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Make REGISTER_ITEM call NEW, like most other REGISTER_* macros
authorotta8634 <k9wolf@pm.me>
Tue, 7 Jan 2025 13:43:12 +0000 (21:43 +0800)
committerotta8634 <k9wolf@pm.me>
Tue, 7 Jan 2025 13:43:12 +0000 (21:43 +0800)
qcsrc/common/items/all.qh
qcsrc/common/items/item/ammo.qh
qcsrc/common/items/item/armor.qh
qcsrc/common/items/item/health.qh
qcsrc/common/items/item/jetpack.qh
qcsrc/common/mutators/mutator/buffs/buffs.qh
qcsrc/common/mutators/mutator/instagib/items.qh
qcsrc/common/mutators/mutator/powerups/powerup/invisibility.qh
qcsrc/common/mutators/mutator/powerups/powerup/shield.qh
qcsrc/common/mutators/mutator/powerups/powerup/speed.qh
qcsrc/common/mutators/mutator/powerups/powerup/strength.qh

index 3d3d62e4631c40e0b4516b25fe9de71e95c84427..e956d297295e7f7407f3cf223cb70216db16596d 100644 (file)
@@ -10,7 +10,7 @@ REGISTRY(Items, 32)
 REGISTRY_DEPENDS(Items, Models)
 #endif
 REGISTER_REGISTRY(Items)
-#define REGISTER_ITEM(id, class) REGISTER(Items, ITEM, id, m_id, NEW(class))
+#define REGISTER_ITEM(id, inst) REGISTER(Items, ITEM, id, m_id, inst)
 
 #ifdef CSQC
 // Copy Items registry here before it gets sorted alphabetically by REGISTRY_SORT
index c9688a282330c8fb97f926132f0ac7139e4a4b34..2bd71924d5c0a3e329315ef899af44f2f5e55718 100644 (file)
@@ -46,7 +46,7 @@ void ammo_shells_init(Pickup this, entity item)
 CLASS(Shells, Ammo)
 ENDCLASS(Shells)
 
-REGISTER_ITEM(Shells, Shells) {
+REGISTER_ITEM(Shells, NEW(Shells)) {
     this.m_canonical_spawnfunc = "item_shells";
 #ifdef GAMEQC
     this.spawnflags = ITEM_FLAG_NORMAL | ITEM_FLAG_RESOURCE;
@@ -82,7 +82,7 @@ void ammo_bullets_init(Pickup this, entity item)
 CLASS(Bullets, Ammo)
 ENDCLASS(Bullets)
 
-REGISTER_ITEM(Bullets, Bullets) {
+REGISTER_ITEM(Bullets, NEW(Bullets)) {
     this.m_canonical_spawnfunc = "item_bullets";
 #ifdef GAMEQC
     this.spawnflags = ITEM_FLAG_NORMAL | ITEM_FLAG_RESOURCE;
@@ -114,7 +114,7 @@ void ammo_rockets_init(Pickup this, entity item)
         SetResourceExplicit(item, RES_ROCKETS, g_pickup_rockets);
 }
 #endif
-REGISTER_ITEM(Rockets, Ammo) {
+REGISTER_ITEM(Rockets, NEW(Ammo)) {
     this.m_canonical_spawnfunc = "item_rockets";
 #ifdef GAMEQC
     this.spawnflags = ITEM_FLAG_NORMAL | ITEM_FLAG_RESOURCE;
@@ -146,7 +146,7 @@ void ammo_cells_init(Pickup this, entity item)
         SetResourceExplicit(item, RES_CELLS, g_pickup_cells);
 }
 #endif
-REGISTER_ITEM(Cells, Ammo) {
+REGISTER_ITEM(Cells, NEW(Ammo)) {
     this.m_canonical_spawnfunc = "item_cells";
 #ifdef GAMEQC
     this.spawnflags = ITEM_FLAG_NORMAL | ITEM_FLAG_RESOURCE;
index b8c3b408f942c6816e7d67c74680a712cc16a18c..87452a911123ef08598b2f691411da96dee48655 100644 (file)
@@ -29,7 +29,7 @@ void item_armorsmall_init(Pickup this, entity item)
 }
 #endif
 
-REGISTER_ITEM(ArmorSmall, Armor) {
+REGISTER_ITEM(ArmorSmall, NEW(Armor)) {
     this.m_canonical_spawnfunc = "item_armor_small";
 #ifdef GAMEQC
     this.spawnflags = ITEM_FLAG_NORMAL | ITEM_FLAG_RESOURCE;
@@ -73,7 +73,7 @@ void item_armormedium_init(Pickup this, entity item)
 }
 #endif
 
-REGISTER_ITEM(ArmorMedium, Armor) {
+REGISTER_ITEM(ArmorMedium, NEW(Armor)) {
     this.m_canonical_spawnfunc = "item_armor_medium";
 #ifdef GAMEQC
     this.spawnflags = ITEM_FLAG_NORMAL | ITEM_FLAG_RESOURCE;
@@ -117,7 +117,7 @@ void item_armorbig_init(Pickup this, entity item)
 }
 #endif
 
-REGISTER_ITEM(ArmorBig, Armor) {
+REGISTER_ITEM(ArmorBig, NEW(Armor)) {
     this.m_canonical_spawnfunc = "item_armor_big";
 #ifdef GAMEQC
     this.spawnflags = ITEM_FLAG_NORMAL | ITEM_FLAG_RESOURCE;
@@ -161,7 +161,7 @@ void item_armormega_init(Pickup this, entity item)
 }
 #endif
 
-REGISTER_ITEM(ArmorMega, Armor) {
+REGISTER_ITEM(ArmorMega, NEW(Armor)) {
     this.m_canonical_spawnfunc = "item_armor_mega";
 #ifdef GAMEQC
     this.spawnflags = ITEM_FLAG_NORMAL | ITEM_FLAG_RESOURCE;
index a028f28c33142b7a10136b015868ce05c2800bc0..c404f388cbdc77581fbefd5d936640b83b52c8ad 100644 (file)
@@ -29,7 +29,7 @@ void item_healthsmall_init(Pickup this, entity item)
 }
 #endif
 
-REGISTER_ITEM(HealthSmall, Health) {
+REGISTER_ITEM(HealthSmall, NEW(Health)) {
     this.m_canonical_spawnfunc = "item_health_small";
 #ifdef GAMEQC
     this.spawnflags = ITEM_FLAG_NORMAL | ITEM_FLAG_RESOURCE;
@@ -74,7 +74,7 @@ void item_healthmedium_init(Pickup this, entity item)
 }
 #endif
 
-REGISTER_ITEM(HealthMedium, Health) {
+REGISTER_ITEM(HealthMedium, NEW(Health)) {
     this.m_canonical_spawnfunc = "item_health_medium";
 #ifdef GAMEQC
     this.spawnflags = ITEM_FLAG_NORMAL | ITEM_FLAG_RESOURCE;
@@ -118,7 +118,7 @@ void item_healthbig_init(Pickup this, entity item)
 }
 #endif
 
-REGISTER_ITEM(HealthBig, Health) {
+REGISTER_ITEM(HealthBig, NEW(Health)) {
     this.m_canonical_spawnfunc = "item_health_big";
 #ifdef GAMEQC
     this.spawnflags = ITEM_FLAG_NORMAL | ITEM_FLAG_RESOURCE;
@@ -162,7 +162,7 @@ void item_healthmega_init(Pickup this, entity item)
 }
 #endif
 
-REGISTER_ITEM(HealthMega, Health) {
+REGISTER_ITEM(HealthMega, NEW(Health)) {
     this.m_canonical_spawnfunc = "item_health_mega";
 #ifdef GAMEQC
     this.spawnflags = ITEM_FLAG_NORMAL | ITEM_FLAG_RESOURCE;
index ca52f5466111e28b0429d64cbeb4714d211d1124..41297c8986558053946c8b9809114be966123e54 100644 (file)
@@ -31,7 +31,7 @@ void powerup_jetpack_init(Pickup def, entity item)
 CLASS(Jetpack, Powerup)
 ENDCLASS(Jetpack)
 
-REGISTER_ITEM(Jetpack, Jetpack) {
+REGISTER_ITEM(Jetpack, NEW(Jetpack)) {
     this.m_canonical_spawnfunc = "item_jetpack";
 #ifdef GAMEQC
        this.spawnflags = ITEM_FLAG_NORMAL;
@@ -65,7 +65,7 @@ void ammo_fuel_init(Pickup this, entity item)
         SetResourceExplicit(item, RES_FUEL, g_pickup_fuel);
 }
 #endif
-REGISTER_ITEM(JetpackFuel, Ammo) {
+REGISTER_ITEM(JetpackFuel, NEW(Ammo)) {
     this.m_canonical_spawnfunc = "item_fuel";
 #ifdef GAMEQC
        this.spawnflags = ITEM_FLAG_NORMAL | ITEM_FLAG_RESOURCE;
@@ -99,7 +99,7 @@ void powerup_fuelregen_init(Pickup def, entity item)
 CLASS(JetpackRegen, Powerup)
 ENDCLASS(JetpackRegen)
 
-REGISTER_ITEM(JetpackRegen, JetpackRegen) {
+REGISTER_ITEM(JetpackRegen, NEW(JetpackRegen)) {
     this.m_canonical_spawnfunc = "item_fuel_regen";
 #ifdef GAMEQC
        this.spawnflags             = ITEM_FLAG_NORMAL;
index a14ad6bb8cdb4e6062cbae72c7244b527bee6177..c02625955c27691ecba58db9a8c227259ae54d09 100644 (file)
@@ -8,8 +8,7 @@
 #include <common/mutators/mutator/waypoints/all.qh>
 #endif
 
-#define REGISTER_BUFF(id, inst) \
-    REGISTER(StatusEffect, BUFF_##id, m_id, inst)
+#define REGISTER_BUFF(id, inst) REGISTER(StatusEffect, BUFF_##id, m_id, inst)
 
 #include <common/mutators/mutator/status_effects/_mod.qh>
 CLASS(Buff, StatusEffects)
index 9be156bb30da9e518e7a2a6026fbe439a23759e3..39d0378d55e9dfc479467f1d4567c0d1cf586baa 100644 (file)
@@ -22,7 +22,7 @@ void ammo_vaporizercells_init(Pickup this, entity item)
         SetResourceExplicit(item, RES_CELLS, autocvar_g_instagib_ammo_drop);
 }
 #endif
-REGISTER_ITEM(VaporizerCells, Ammo) {
+REGISTER_ITEM(VaporizerCells, NEW(Ammo)) {
     this.m_canonical_spawnfunc = "item_vaporizer_cells";
 #ifdef GAMEQC
     this.spawnflags = ITEM_FLAG_MUTATORBLOCKED;
@@ -49,7 +49,7 @@ MODEL(ExtraLife_ITEM, Item_Model("g_h100.md3"));
 SOUND(ExtraLife, Item_Sound("megahealth"));
 #endif
 
-REGISTER_ITEM(ExtraLife, Powerup) {
+REGISTER_ITEM(ExtraLife, NEW(Powerup)) {
     this.m_canonical_spawnfunc = "item_extralife";
 #ifdef GAMEQC
        this.m_model                =   MDL_ExtraLife_ITEM;
index 690abb5ca2fe207b7fb41bd7c6ac7af82bcc7786..df25c8a9c8cd76faf9c2f3a26aa763318bf1062b 100644 (file)
@@ -28,7 +28,7 @@ void powerup_invisibility_init(Pickup def, entity item)
         item.invisibility_finished = (item.count) ? item.count : autocvar_g_balance_powerup_invisibility_time;
 }
 #endif
-REGISTER_ITEM(Invisibility, Powerup) {
+REGISTER_ITEM(Invisibility, NEW(Powerup)) {
     this.m_canonical_spawnfunc = "item_invisibility";
 #ifdef SVQC
     this.m_iteminit         =   powerup_invisibility_init;
index de2f5dc29a40b544cce37631070c358460b731fb..ac7faaeda0dc6f68b7119e148fa197f732030a67 100644 (file)
@@ -27,7 +27,7 @@ void powerup_shield_init(Pickup def, entity item)
         item.invincible_finished = (item.count) ? item.count : autocvar_g_balance_powerup_invincible_time;
 }
 #endif
-REGISTER_ITEM(Shield, Powerup) {
+REGISTER_ITEM(Shield, NEW(Powerup)) {
     this.m_canonical_spawnfunc = "item_shield";
 #ifdef SVQC
     this.m_iteminit         =   powerup_shield_init;
index 38010e480b1c723b5d0449ef0616ad0629cd3c4b..6b4653546dea215733ca8e19745060cc854aec02 100644 (file)
@@ -29,7 +29,7 @@ void powerup_speed_init(Pickup def, entity item)
         item.speed_finished = (item.count) ? item.count : autocvar_g_balance_powerup_speed_time;
 }
 #endif
-REGISTER_ITEM(Speed, Powerup) {
+REGISTER_ITEM(Speed, NEW(Powerup)) {
     this.m_canonical_spawnfunc = "item_speed";
 #ifdef SVQC
     this.m_iteminit         =   powerup_speed_init;
index 79ef229f1cbbf751b5b0a39ac5b76ab7f6fa70d4..3567cb1c34e0cc25925b715713c92d8cf04ff9d6 100644 (file)
@@ -29,7 +29,7 @@ void powerup_strength_init(Pickup def, entity item)
         item.strength_finished = (item.count) ? item.count : autocvar_g_balance_powerup_strength_time;
 }
 #endif
-REGISTER_ITEM(Strength, Powerup) {
+REGISTER_ITEM(Strength, NEW(Powerup)) {
     this.m_canonical_spawnfunc = "item_strength";
 #ifdef SVQC
     this.m_iteminit         =   powerup_strength_init;