X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fcommon%2Fitems%2Fitem%2Fammo.qc;h=3a13a1f81855c51c2eaeea4bea5adda6e10c07b3;hb=9e113dae328809b5e7432f434649a35ebb185a52;hp=7267f8d07288729a89d3c60429334372e62094f5;hpb=f604d84f61f6db78cf9cb7c3cc6b9cfe7f14278f;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/common/items/item/ammo.qc b/qcsrc/common/items/item/ammo.qc index 7267f8d07..3a13a1f81 100644 --- a/qcsrc/common/items/item/ammo.qc +++ b/qcsrc/common/items/item/ammo.qc @@ -1,73 +1,23 @@ #include "ammo.qh" -#include "../../../server/t_items.qh" -#define WITH(it) this.m_##it; -#define CONFIGURE(...) MAP(WITH, __VA_ARGS__) -#define DEFINE(id, ...) \ - REGISTER_ITEM(id, Ammo, LAMBDA( \ - IF(SV, CONFIGURE \ - , respawntime = g_pickup_respawntime_ammo \ - , respawntimejitter = g_pickup_respawntimejitter_ammo \ - ) \ - MAP(IDENTITY, __VA_ARGS__) \ - )) +#ifdef SVQC -DEFINE(Bullets - ,IF(ALL, CONFIGURE - , model = "models/items/a_bullets.mdl" - , sound = "misc/itempickup.wav" - , name = "bullets" - , itemid = IT_NAILS - ) - ,IF(SV, CONFIGURE - , botvalue = 2000 - ) -) -DEFINE(Cells - ,IF(ALL, CONFIGURE - , model = "models/items/a_cells.md3" - , sound = "misc/itempickup.wav" - , name = "cells" - , itemid = IT_ROCKETS - ) - ,IF(SV, CONFIGURE - , botvalue = 2000 - ) -) -DEFINE(Plasma - ,IF(ALL, CONFIGURE - , model = "models/items/a_cells.md3" - , sound = "misc/itempickup.wav" - , name = "plasma" - , itemid = IT_ROCKETS - ) - ,IF(SV, CONFIGURE - , botvalue = 2000 - ) -) -DEFINE(Rockets - ,IF(ALL, CONFIGURE - , model = "models/items/a_rockets.md3" - , sound = "misc/itempickup.wav" - , name = "rockets" - , itemid = IT_ROCKETS - ) - ,IF(SV, CONFIGURE - , botvalue = 3000 - ) -) -DEFINE(Shells - ,IF(ALL, CONFIGURE - , model = "models/items/a_shells.md3" - , sound = "misc/itempickup.wav" - , name = "shells" - , itemid = IT_SHELLS - ) - ,IF(SV, CONFIGURE - , botvalue = 500 - ) -) +METHOD(Bullets, m_spawnfunc_hookreplace, GameItem(Bullets this, entity e)) +{ + if (autocvar_sv_q3acompat_machineshotgunswap && !Item_IsLoot(e)) + { + return ITEM_Shells; + } + return this; +} -#undef WITH -#undef CONFIGURE -#undef DEFINE +METHOD(Shells, m_spawnfunc_hookreplace, GameItem(Shells this, entity e)) +{ + if (autocvar_sv_q3acompat_machineshotgunswap && !Item_IsLoot(e)) + { + return ITEM_Bullets; + } + return this; +} + +#endif