#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) \
- ) \
- UNWORDS(__VA_ARGS__) \
- ))
+METHOD(Bullets, m_spawnfunc_hookreplace, GameItem(Bullets this, entity e))
+{
+ if (autocvar_sv_q3acompat_machineshotgunswap && !Item_IsLoot(e))
+ {
+ return ITEM_Shells;
+ }
+ return this;
+}
-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