X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fcommon%2Fweapons%2Fweapon.qh;h=ec6e14eb668d8ef63e33cb6aaf2577fc464033cb;hb=5ad35ed58c9eb8f52afd13db42f712d308d807df;hp=916acdf9ed97c0cc316685a6bab8eadeb8c3cbf5;hpb=dc02e4d78fb0e67b47a0c1e150b4c18c0711b8bf;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/common/weapons/weapon.qh b/qcsrc/common/weapons/weapon.qh index 916acdf9e..ec6e14eb6 100644 --- a/qcsrc/common/weapons/weapon.qh +++ b/qcsrc/common/weapons/weapon.qh @@ -1,7 +1,7 @@ #pragma once -#include #include +#include #include #ifdef SVQC @@ -45,7 +45,7 @@ CLASS(Weapon, Object) /** control what happens when this weapon is spawned */ METHOD(Weapon, m_spawnfunc_hookreplace, Weapon(Weapon this, entity e)) { return this; } /** M: ammotype : main ammo type */ - ATTRIB(Weapon, ammo_type, int, RES_NONE); + ATTRIB(Weapon, ammo_type, Resource, RES_NONE); /** M: impulse : weapon impulse */ ATTRIB(Weapon, impulse, int, -1); /** M: flags : WEPSPAWNFLAG_... combined */ @@ -136,11 +136,7 @@ void weapon_defaultspawnfunc(entity this, Weapon e); spawnfunc(name) { weapon_defaultspawnfunc(this, weapon); } #define SPAWNFUNC_WEAPON_COND(name, cond, wep1, wep2) \ - spawnfunc(name) \ - { \ - entity wep = (cond) ? wep1 : wep2; \ - weapon_defaultspawnfunc(this, wep); \ - } + SPAWNFUNC_WEAPON(name, (cond ? wep1 : wep2)) #else @@ -227,19 +223,16 @@ string W_FixWeaponOrder_AllowIncomplete(entity this, string order); string W_FixWeaponOrder_ForceComplete(string order); WepSet W_RandomWeapons(entity e, WepSet remaining, int n); -string GetAmmoPicture(int ammotype); +string GetAmmoPicture(Resource ammotype); -string GetAmmoName(int ammotype); +string GetAmmoName(Resource ammotype); -entity GetAmmoItem(int ammotype); - -#ifdef SVQC -int GetAmmoConsumptionPrimary(string netname); -#endif +entity GetAmmoItem(Resource ammotype); #ifdef CSQC -int GetAmmoTypeFromNum(int i); -int GetAmmoStat(int ammotype); +Resource GetAmmoTypeFromNum(int i); + +int GetAmmoStat(Resource ammotype); #endif string W_Sound(string w_snd);