]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/items/item/ammo.qc
Merge branch 'master' into cloudwalk9/mgburstfix
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / items / item / ammo.qc
index 23f8d8aae5a36660426ba54b7721b9f02a99bb6b..739d94aca1e8b3fb9954ce8a278570f96c6363cf 100644 (file)
@@ -1,70 +1,14 @@
 #include "ammo.qh"
-#ifdef SVQC
-    #include "../../../server/t_items.qh"
-#endif
 
-#define WITH(it) this.m_##it;
-#define CONFIGURE(...) MAP(WITH, __VA_ARGS__)
-#define DEFINE(id, ...)                                                 \
-    REGISTER_ITEM(id, Ammo, LAMBDA(                                     \
-        IF(SV, CONFIGURE                                                \
-        ,   respawntime         =       GET(g_pickup_respawntime_ammo)  \
-        ,   respawntimejitter   = GET(g_pickup_respawntimejitter_ammo)  \
-        )                                                               \
-        MAP(IDENTITY, __VA_ARGS__)                                      \
-    ))
+#ifdef SVQC
 
-DEFINE(Bullets
-    ,APPLY(CONFIGURE
-    ,   model               =   "models/items/a_bullets.mdl"
-    ,   name                =   "bullets"
-    )
-    ,IF(SV, CONFIGURE
-    ,   botvalue            =   2000
-    ,   itemid              =   IT_NAILS
-    )
-)
-DEFINE(Cells
-    ,APPLY(CONFIGURE
-    ,   model               =   "models/items/a_cells.md3"
-    ,   name                =   "cells"
-    )
-    ,IF(SV, CONFIGURE
-    ,   botvalue            =   2000
-    ,   itemid              =   IT_CELLS
-    )
-)
-DEFINE(Plasma
-    ,APPLY(CONFIGURE
-    ,   model               =   "models/items/a_cells.md3"
-    ,   name                =   "plasma"
-    )
-    ,IF(SV, CONFIGURE
-    ,   botvalue            =   2000
-    ,   itemid              =   IT_PLASMA
-    )
-)
-DEFINE(Rockets
-    ,APPLY(CONFIGURE
-    ,   model               =   "models/items/a_rockets.md3"
-    ,   name                =   "rockets"
-    )
-    ,IF(SV, CONFIGURE
-    ,   botvalue            =   3000
-    ,   itemid              =   IT_ROCKETS
-    )
-)
-DEFINE(Shells
-    ,APPLY(CONFIGURE
-    ,   model               =   "models/items/a_shells.md3"
-    ,   name                =   "shells"
-    )
-    ,IF(SV, CONFIGURE
-    ,   botvalue            =   500
-    ,   itemid              =   IT_SHELLS
-    )
-)
+METHOD(Shells, m_spawnfunc_hookreplace, GameItem(Shells this, entity e))
+{
+       if (autocvar_sv_q3acompat_machineshotgunswap && !Item_IsLoot(e))
+       {
+               return ITEM_Bullets;
+       }
+       return this;
+}
 
-#undef WITH
-#undef CONFIGURE
-#undef DEFINE
+#endif