]> 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 9bce0839a28a1cb7fa00952100188f0659bf5f57..3a13a1f81855c51c2eaeea4bea5adda6e10c07b3 100644 (file)
@@ -1,57 +1,23 @@
 #include "ammo.qh"
-#include "../../../server/t_items.qh"
 
-#define REGISTER_AMMO(id, model, sound, name, itemid, basevalue) \
-REGISTER_ITEM(id, Ammo, LAMBDA({    \
-    this.ammoModel = model;         \
-    this.ammoSound = sound;         \
-    this.ammoName = name;           \
-    this.ammoId = itemid;           \
-    this.ammoQuantity = basevalue;  \
-}))
+#ifdef SVQC
 
-REGISTER_AMMO(Bullets,
-    "models/items/a_bullets.mdl",
-    "misc/itempickup.wav",
-    "bullets",
-    IT_NAILS,
-    2000
-)
-REGISTER_AMMO(Cells,
-    "models/items/a_cells.md3",
-    "misc/itempickup.wav",
-    "cells",
-    IT_ROCKETS,
-    2000
-)
-REGISTER_AMMO(Plasma,
-    "models/items/a_cells.md3",
-    "misc/itempickup.wav",
-    "plasma",
-    IT_ROCKETS,
-    2000
-)
-REGISTER_AMMO(Rockets,
-    "models/items/a_rockets.md3",
-    "misc/itempickup.wav",
-    "rockets",
-    IT_ROCKETS,
-    3000
-)
-REGISTER_AMMO(Shells,
-    "models/items/a_shells.md3",
-    "misc/itempickup.wav",
-    "shells",
-    IT_SHELLS,
-    500
-)
+METHOD(Bullets, m_spawnfunc_hookreplace, GameItem(Bullets this, entity e))
+{
+       if (autocvar_sv_q3acompat_machineshotgunswap && !Item_IsLoot(e))
+       {
+               return ITEM_Shells;
+       }
+       return this;
+}
 
-bool Ammo_respondTo(entity this, int request)
+METHOD(Shells, m_spawnfunc_hookreplace, GameItem(Shells this, entity e))
 {
-    switch (request) {
-        default: return false;
-        case ITEM_SIGNAL(Default):
-            print(strcat(this.ammoName, " responding\n"));
-            return true;
-    }
+       if (autocvar_sv_q3acompat_machineshotgunswap && !Item_IsLoot(e))
+       {
+               return ITEM_Bullets;
+       }
+       return this;
 }
+
+#endif