X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fcommon%2Fitems%2Fitem%2Fammo.qc;h=3a13a1f81855c51c2eaeea4bea5adda6e10c07b3;hb=9e113dae328809b5e7432f434649a35ebb185a52;hp=525a5b3d930a14d07fb47ca546a1dd41b94ef7d0;hpb=f41d9f31538bef0259d2b2c74536bb977901f99d;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/common/items/item/ammo.qc b/qcsrc/common/items/item/ammo.qc index 525a5b3d9..3a13a1f81 100644 --- a/qcsrc/common/items/item/ammo.qc +++ b/qcsrc/common/items/item/ammo.qc @@ -1,84 +1,23 @@ #include "ammo.qh" -#ifdef SVQC - #include -#endif - -#ifndef MENUQC -MODEL(Bullets_ITEM, Item_Model("a_bullets.mdl")); -#endif -REGISTER_ITEM(Bullets, Ammo) { -#ifndef MENUQC - this.m_model = MDL_Bullets_ITEM; -#endif - this.m_name = "bullets"; - this.m_icon = "ammo_bullets"; #ifdef SVQC - this.m_botvalue = 2000; - this.m_itemid = IT_NAILS; -#endif -} -#ifndef MENUQC -MODEL(Cells_ITEM, Item_Model("a_cells.md3")); -#endif - -REGISTER_ITEM(Cells, Ammo) { -#ifndef MENUQC - this.m_model = MDL_Cells_ITEM; -#endif - this.m_name = "cells"; - this.m_icon = "ammo_cells"; -#ifdef SVQC - this.m_botvalue = 2000; - this.m_itemid = IT_CELLS; -#endif +METHOD(Bullets, m_spawnfunc_hookreplace, GameItem(Bullets this, entity e)) +{ + if (autocvar_sv_q3acompat_machineshotgunswap && !Item_IsLoot(e)) + { + return ITEM_Shells; + } + return this; } -#ifndef MENUQC -MODEL(Plasma_ITEM, Item_Model("a_cells.md3")); -#endif - -REGISTER_ITEM(Plasma, Ammo) { -#ifndef MENUQC - this.m_model = MDL_Plasma_ITEM; -#endif - this.m_name = "plasma"; - this.m_icon = "ammo_plasma"; -#ifdef SVQC - this.m_botvalue = 2000; - this.m_itemid = IT_PLASMA; -#endif -} - -#ifndef MENUQC -MODEL(Rockets_ITEM, Item_Model("a_rockets.md3")); -#endif - -REGISTER_ITEM(Rockets, Ammo) { -#ifndef MENUQC - this.m_model = MDL_Rockets_ITEM; -#endif - 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; } -#ifndef MENUQC -MODEL(Shells_ITEM, Item_Model("a_shells.md3")); -#endif - -REGISTER_ITEM(Shells, Ammo) { -#ifndef MENUQC - this.m_model = MDL_Shells_ITEM; #endif - this.m_name = "shells"; - this.m_icon = "ammo_shells"; -#ifdef SVQC - this.m_botvalue = 500; - this.m_itemid = IT_SHELLS; -#endif -}