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