From c8c2694e0617e1482f05561b6e2035f39442ed0c Mon Sep 17 00:00:00 2001 From: TimePath Date: Fri, 10 Jul 2015 20:12:45 +1000 Subject: [PATCH] Fix an oversight in the item system --- qcsrc/common/items/all.inc | 2 + qcsrc/common/items/item.qh | 1 + qcsrc/server/mutators/mutator_instagib.qc | 42 +------------------ .../server/mutators/mutator_instagib_items.qc | 41 ++++++++++++++++++ 4 files changed, 45 insertions(+), 41 deletions(-) create mode 100644 qcsrc/server/mutators/mutator_instagib_items.qc diff --git a/qcsrc/common/items/all.inc b/qcsrc/common/items/all.inc index 2c4f1dea4..93901a1d1 100644 --- a/qcsrc/common/items/all.inc +++ b/qcsrc/common/items/all.inc @@ -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" diff --git a/qcsrc/common/items/item.qh b/qcsrc/common/items/item.qh index da4e7a453..354bed2ba 100644 --- a/qcsrc/common/items/item.qh +++ b/qcsrc/common/items/item.qh @@ -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() { \ diff --git a/qcsrc/server/mutators/mutator_instagib.qc b/qcsrc/server/mutators/mutator_instagib.qc index 161dba90d..17381d34a 100644 --- a/qcsrc/server/mutators/mutator_instagib.qc +++ b/qcsrc/server/mutators/mutator_instagib.qc @@ -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 index 000000000..40340b172 --- /dev/null +++ b/qcsrc/server/mutators/mutator_instagib_items.qc @@ -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 -- 2.39.2