X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fcommon%2Fitems%2Fitem%2Fammo.qc;h=3a13a1f81855c51c2eaeea4bea5adda6e10c07b3;hb=9e113dae328809b5e7432f434649a35ebb185a52;hp=2d487a7b51be6723a030f44af5e14d5997da9883;hpb=785232fc90ed7bd7038c79f65534a7e79efd7f45;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/common/items/item/ammo.qc b/qcsrc/common/items/item/ammo.qc index 2d487a7b5..3a13a1f81 100644 --- a/qcsrc/common/items/item/ammo.qc +++ b/qcsrc/common/items/item/ammo.qc @@ -1,50 +1,23 @@ #include "ammo.qh" -#ifdef SVQC - #include "../../../server/t_items.qh" -#endif -REGISTER_ITEM(Bullets, Ammo) { - this.m_model = "a_bullets.mdl"; - this.m_name = "bullets"; - this.m_icon = "ammo_bullets"; -#ifdef SVQC - this.m_botvalue = 2000; - this.m_itemid = IT_NAILS; -#endif -} -REGISTER_ITEM(Cells, Ammo) { - this.m_model = "a_cells.md3"; - this.m_name = "cells"; - this.m_icon = "ammo_cells"; -#ifdef SVQC - this.m_botvalue = 2000; - this.m_itemid = IT_CELLS; -#endif -} -REGISTER_ITEM(Plasma, Ammo) { - this.m_model = "a_cells.md3"; - this.m_name = "plasma"; - this.m_icon = "ammo_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 = "a_rockets.md3"; - this.m_name = "rockets"; - this.m_icon = "ammo_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 = "a_shells.md3"; - this.m_name = "shells"; - this.m_icon = "ammo_shells"; -#ifdef SVQC - this.m_botvalue = 500; - this.m_itemid = IT_SHELLS; + #endif -}