X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fcommon%2Fweapons%2Fall.qc;h=7ef3cc1e8d7a5ee18ff37591f899d635d8e0ee6d;hb=f2b27d4b960a11b7c0dd45dc4439edab40bcbfcb;hp=11ac0641a2c18be823715cd6c17df3d8f975bbb3;hpb=ac7deb97b1a0e73ceea4684be73e72912fb3f1aa;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/common/weapons/all.qc b/qcsrc/common/weapons/all.qc index 11ac0641a..7ef3cc1e8 100644 --- a/qcsrc/common/weapons/all.qc +++ b/qcsrc/common/weapons/all.qc @@ -61,11 +61,11 @@ WepSet _WepSet_FromWeapon(int a) if (a >= 24) { a -= 24; - return '0 0 1' * (2 ** a); + return '0 0 1' * BIT(a); } - return '0 1 0' * (2 ** a); + return '0 1 0' * BIT(a); } - return '1 0 0' * (2 ** a); + return '1 0 0' * BIT(a); } #ifdef SVQC void WriteWepSet(float dst, WepSet w) @@ -230,6 +230,23 @@ string GetAmmoName(int ammotype) } } +entity GetAmmoItem(int ammotype) +{ + switch (ammotype) + { + case RES_SHELLS: return ITEM_Shells; + case RES_BULLETS: return ITEM_Bullets; + case RES_ROCKETS: return ITEM_Rockets; + case RES_CELLS: return ITEM_Cells; + case RES_PLASMA: return ITEM_Plasma; + case RES_FUEL: return ITEM_JetpackFuel; + } + LOG_WARNF("Invalid ammo type %d ", ammotype); + return NULL; + // WEAPONTODO: use this generic func to reduce duplication ? + // GetAmmoPicture GetAmmoName notif_arg_item_wepammo ammo_pickupevalfunc ? +} + #ifdef CSQC int GetAmmoTypeFromNum(int i) {