]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Fix an oversight in the item system
authorTimePath <andrew.hardaker1995@gmail.com>
Fri, 10 Jul 2015 10:12:45 +0000 (20:12 +1000)
committerTimePath <andrew.hardaker1995@gmail.com>
Fri, 10 Jul 2015 10:12:45 +0000 (20:12 +1000)
qcsrc/common/items/all.inc
qcsrc/common/items/item.qh
qcsrc/server/mutators/mutator_instagib.qc
qcsrc/server/mutators/mutator_instagib_items.qc [new file with mode: 0644]

index 2c4f1dea465fb021ec7fb2e72dc05fc4f47250da..93901a1d1b4b6f92cb71c8c60b3d1525be2e6e5c 100644 (file)
@@ -1,3 +1,4 @@
+/** If you register a new item, make sure to add it to this list */
 #include "item/ammo.qc"
 #include "item/armor.qc"
 #include "item/buff.qc"
@@ -5,3 +6,4 @@
 #include "item/jetpack.qc"
 #include "item/pickup.qc"
 #include "item/powerup.qc"
+#include "../../server/mutators/mutator_instagib_items.qc"
index da4e7a4537d1130d7cfc45058a28f6afe7c85ad6..354bed2ba74ed2e24498a9f62c1a2d18c20a5ca6 100644 (file)
@@ -11,6 +11,7 @@ ENDCLASS(GameItem)
 
 
 int ITEM_COUNT;
+/** If you register a new item, make sure to add it to all.inc */
 #define REGISTER_ITEM(id, class, body)          \
     entity ITEM_##id;                           \
     void RegisterItems_##id() {                 \
index 161dba90deb0c68d22f65ee5e65b96d4cf87de33..17381d34aba82e5151b09c7d9e4fed29d03f24f7 100644 (file)
@@ -5,47 +5,7 @@
 #include "../cl_client.qh"
 #include "../../common/buffs.qh"
 
-#include "../../common/items/item.qh"
-
-#define WITH(it) this.m_##it;
-#define CONFIGURE(...) MAP(WITH, __VA_ARGS__)
-
-float instagib_respawntime_ammo = 45;
-float instagib_respawntimejitter_ammo = 0;
-GETTER(float, instagib_respawntime_ammo)
-GETTER(float, instagib_respawntimejitter_ammo)
-
-REGISTER_ITEM(VaporizerCells, Pickup, APPLY(UNWORDS
-    ,APPLY(CONFIGURE
-    ,   model               =   "models/items/a_cells.md3"
-    ,   sound               =   "misc/itempickup.wav"
-    ,   name                =   "Vaporizer Ammo"
-    )
-    ,IF(SV, CONFIGURE
-    ,   botvalue            =   100
-    ,   itemid              =   IT_CELLS
-    ,   respawntime         =         GET(instagib_respawntime_ammo)
-    ,   respawntimejitter   =   GET(instagib_respawntimejitter_ammo)
-    )
-))
-
-REGISTER_ITEM(ExtraLife, Pickup, APPLY(UNWORDS
-    ,APPLY(CONFIGURE
-    ,   model               =   "models/items/g_h100.md3"
-    ,   sound               =   "misc/megahealth.wav"
-    ,   name                =   "Extralife"
-    )
-    ,IF(SV, CONFIGURE
-    ,   botvalue            =   BOT_PICKUP_RATING_HIGH
-    ,   itemflags           =   FL_POWERUP
-    ,   itemid              =   IT_NAILS
-    ,   respawntime         =         GET(g_pickup_respawntime_powerup)
-    ,   respawntimejitter   =   GET(g_pickup_respawntimejitter_powerup)
-    )
-))
-
-#undef WITH
-#undef CONFIGURE
+#include "../../common/items/all.qc"
 
 void spawnfunc_item_minst_cells (void)
 {
diff --git a/qcsrc/server/mutators/mutator_instagib_items.qc b/qcsrc/server/mutators/mutator_instagib_items.qc
new file mode 100644 (file)
index 0000000..40340b1
--- /dev/null
@@ -0,0 +1,41 @@
+#include "../../common/items/item.qh"
+
+#define WITH(it) this.m_##it;
+#define CONFIGURE(...) MAP(WITH, __VA_ARGS__)
+
+float instagib_respawntime_ammo = 45;
+float instagib_respawntimejitter_ammo = 0;
+GETTER(float, instagib_respawntime_ammo)
+GETTER(float, instagib_respawntimejitter_ammo)
+
+REGISTER_ITEM(VaporizerCells, Pickup, APPLY(UNWORDS
+    ,APPLY(CONFIGURE
+    ,   model               =   "models/items/a_cells.md3"
+    ,   sound               =   "misc/itempickup.wav"
+    ,   name                =   "Vaporizer Ammo"
+    )
+    ,IF(SV, CONFIGURE
+    ,   botvalue            =   100
+    ,   itemid              =   IT_CELLS
+    ,   respawntime         =         GET(instagib_respawntime_ammo)
+    ,   respawntimejitter   =   GET(instagib_respawntimejitter_ammo)
+    )
+))
+
+REGISTER_ITEM(ExtraLife, Pickup, APPLY(UNWORDS
+    ,APPLY(CONFIGURE
+    ,   model               =   "models/items/g_h100.md3"
+    ,   sound               =   "misc/megahealth.wav"
+    ,   name                =   "Extralife"
+    )
+    ,IF(SV, CONFIGURE
+    ,   botvalue            =   BOT_PICKUP_RATING_HIGH
+    ,   itemflags           =   FL_POWERUP
+    ,   itemid              =   IT_NAILS
+    ,   respawntime         =         GET(g_pickup_respawntime_powerup)
+    ,   respawntimejitter   =   GET(g_pickup_respawntimejitter_powerup)
+    )
+))
+
+#undef WITH
+#undef CONFIGURE