]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/weapons/all.qc
Support count field of Q3 ammo pickups, also tuba support
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / weapons / all.qc
index 6b675468c91c4c6a7f870dcc82663785250ca4ba..631aaf11b51c2a910229cac79426cb986c98f6c1 100644 (file)
@@ -237,6 +237,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 SVQC
 int GetAmmoConsumptionPrimary(string netname)
 // Returns ammo consumed per shot by the primary/default fire mode