X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fcommon%2Fitems%2Fitem%2Fammo.qc;h=3a13a1f81855c51c2eaeea4bea5adda6e10c07b3;hb=60b0e81cdaed847a7aac9d234f219937ab9462b2;hp=9bce0839a28a1cb7fa00952100188f0659bf5f57;hpb=ee91ec05fdfba024c9b3221045baa786190dd9b6;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/common/items/item/ammo.qc b/qcsrc/common/items/item/ammo.qc index 9bce0839a..3a13a1f81 100644 --- a/qcsrc/common/items/item/ammo.qc +++ b/qcsrc/common/items/item/ammo.qc @@ -1,57 +1,23 @@ #include "ammo.qh" -#include "../../../server/t_items.qh" -#define REGISTER_AMMO(id, model, sound, name, itemid, basevalue) \ -REGISTER_ITEM(id, Ammo, LAMBDA({ \ - this.ammoModel = model; \ - this.ammoSound = sound; \ - this.ammoName = name; \ - this.ammoId = itemid; \ - this.ammoQuantity = basevalue; \ -})) +#ifdef SVQC -REGISTER_AMMO(Bullets, - "models/items/a_bullets.mdl", - "misc/itempickup.wav", - "bullets", - IT_NAILS, - 2000 -) -REGISTER_AMMO(Cells, - "models/items/a_cells.md3", - "misc/itempickup.wav", - "cells", - IT_ROCKETS, - 2000 -) -REGISTER_AMMO(Plasma, - "models/items/a_cells.md3", - "misc/itempickup.wav", - "plasma", - IT_ROCKETS, - 2000 -) -REGISTER_AMMO(Rockets, - "models/items/a_rockets.md3", - "misc/itempickup.wav", - "rockets", - IT_ROCKETS, - 3000 -) -REGISTER_AMMO(Shells, - "models/items/a_shells.md3", - "misc/itempickup.wav", - "shells", - IT_SHELLS, - 500 -) +METHOD(Bullets, m_spawnfunc_hookreplace, GameItem(Bullets this, entity e)) +{ + if (autocvar_sv_q3acompat_machineshotgunswap && !Item_IsLoot(e)) + { + return ITEM_Shells; + } + return this; +} -bool Ammo_respondTo(entity this, int request) +METHOD(Shells, m_spawnfunc_hookreplace, GameItem(Shells this, entity e)) { - switch (request) { - default: return false; - case ITEM_SIGNAL(Default): - print(strcat(this.ammoName, " responding\n")); - return true; - } + if (autocvar_sv_q3acompat_machineshotgunswap && !Item_IsLoot(e)) + { + return ITEM_Bullets; + } + return this; } + +#endif