]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/mutators/mutator/instagib/items.qh
Add an item init attribute function, so the item's default values aren't applied...
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / mutators / mutator / instagib / items.qh
index d9f641d8200316387529a5093f90664a4c95f189..1851f1b677f134d6d7da493109fe9aa8c2659807 100644 (file)
@@ -14,6 +14,14 @@ MODEL(VaporizerCells_ITEM, Item_Model("a_cells.md3"));
 SOUND(VaporizerCells, Item_Sound("itempickup"));
 #endif
 
+#ifdef SVQC
+int autocvar_g_instagib_ammo_drop;
+void ammo_vaporizercells_init(entity item)
+{
+    if(!item.ammo_cells)
+        item.ammo_cells = autocvar_g_instagib_ammo_drop;
+}
+#endif
 REGISTER_ITEM(VaporizerCells, Ammo) {
 #ifdef GAMEQC
     this.m_model                =   MDL_VaporizerCells_ITEM;
@@ -26,6 +34,7 @@ REGISTER_ITEM(VaporizerCells, Ammo) {
     this.m_itemid               =   IT_CELLS;
     this.m_respawntime          =   GET(instagib_respawntime_ammo);
     this.m_respawntimejitter    =   GET(instagib_respawntimejitter_ammo);
+    this.m_iteminit             =   ammo_vaporizercells_init;
 #endif
 }