]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/items/item/ammo.qc
Merge branch 'master' into Mario/stats_eloranking
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / items / item / ammo.qc
index dc0909d1ee8404f6aca32cf13b692ee508b1a992..3a13a1f81855c51c2eaeea4bea5adda6e10c07b3 100644 (file)
@@ -1,49 +1,23 @@
 #include "ammo.qh"
-#include "../../../server/t_items.qh"
 
-#define WITH(it) this.m_##it;
+#ifdef SVQC
 
-#define REGISTER_AMMO(id, ...)                      \
-    REGISTER_ITEM(id, Ammo, LAMBDA({                \
-        MAP(WITH, __VA_ARGS__)                      \
-        this.m_respawntime = SPAWNTIME_AMMO;        \
-        this.m_respawntimejitter = SPAWNTIME_AMMO;  \
-    }))
+METHOD(Bullets, m_spawnfunc_hookreplace, GameItem(Bullets this, entity e))
+{
+       if (autocvar_sv_q3acompat_machineshotgunswap && !Item_IsLoot(e))
+       {
+               return ITEM_Shells;
+       }
+       return this;
+}
 
-REGISTER_AMMO(Bullets
-    , model     = "models/items/a_bullets.mdl"
-    , sound     = "misc/itempickup.wav"
-    , name      = "bullets"
-    , itemid    = IT_NAILS
-    , botvalue  = 2000
-)
-REGISTER_AMMO(Cells
-    , model     = "models/items/a_cells.md3"
-    , sound     = "misc/itempickup.wav"
-    , name      = "cells"
-    , itemid    = IT_ROCKETS
-    , botvalue  = 2000
-)
-REGISTER_AMMO(Plasma
-    , model     = "models/items/a_cells.md3"
-    , sound     = "misc/itempickup.wav"
-    , name      = "plasma"
-    , itemid    = IT_ROCKETS
-    , botvalue  = 2000
-)
-REGISTER_AMMO(Rockets
-    , model     = "models/items/a_rockets.md3"
-    , sound     = "misc/itempickup.wav"
-    , name      = "rockets"
-    , itemid    = IT_ROCKETS
-    , botvalue  = 3000
-)
-REGISTER_AMMO(Shells
-    , model     = "models/items/a_shells.md3"
-    , sound     = "misc/itempickup.wav"
-    , name      = "shells"
-    , itemid    = IT_SHELLS
-    , botvalue  = 500
-)
+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
+#endif