X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fcommon%2Fitems%2Fitem%2Fammo.qc;h=3a13a1f81855c51c2eaeea4bea5adda6e10c07b3;hb=60b0e81cdaed847a7aac9d234f219937ab9462b2;hp=58f30fb848483ca8438593174e44e3d58592dd92;hpb=cc795f09aace41eb64e988c37af78fa5f8af17fc;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/common/items/item/ammo.qc b/qcsrc/common/items/item/ammo.qc index 58f30fb84..3a13a1f81 100644 --- a/qcsrc/common/items/item/ammo.qc +++ b/qcsrc/common/items/item/ammo.qc @@ -1,45 +1,23 @@ #include "ammo.qh" -#ifdef SVQC - #include "../../../server/t_items.qh" -#endif -REGISTER_ITEM(Bullets, Ammo) { - this.m_model = "models/items/a_bullets.mdl"; - this.m_name = "bullets"; -#ifdef SVQC - this.m_botvalue = 2000; - this.m_itemid = IT_NAILS; -#endif -} -REGISTER_ITEM(Cells, Ammo) { - this.m_model = "models/items/a_cells.md3"; - this.m_name = "cells"; -#ifdef SVQC - this.m_botvalue = 2000; - this.m_itemid = IT_CELLS; -#endif -} -REGISTER_ITEM(Plasma, Ammo) { - this.m_model = "models/items/a_cells.md3"; - this.m_name = "plasma"; #ifdef SVQC - this.m_botvalue = 2000; - this.m_itemid = IT_PLASMA; -#endif + +METHOD(Bullets, m_spawnfunc_hookreplace, GameItem(Bullets this, entity e)) +{ + if (autocvar_sv_q3acompat_machineshotgunswap && !Item_IsLoot(e)) + { + return ITEM_Shells; + } + return this; } -REGISTER_ITEM(Rockets, Ammo) { - this.m_model = "models/items/a_rockets.md3"; - this.m_name = "rockets"; -#ifdef SVQC - this.m_botvalue = 3000; - this.m_itemid = IT_ROCKETS; -#endif + +METHOD(Shells, m_spawnfunc_hookreplace, GameItem(Shells this, entity e)) +{ + if (autocvar_sv_q3acompat_machineshotgunswap && !Item_IsLoot(e)) + { + return ITEM_Bullets; + } + return this; } -REGISTER_ITEM(Shells, Ammo) { - this.m_model = "models/items/a_shells.md3"; - this.m_name = "shells"; -#ifdef SVQC - this.m_botvalue = 500; - this.m_itemid = IT_SHELLS; + #endif -}