Skip to content

Commit

Permalink
Merge pull request #3265 from CombatExtended-Continued/ModdedVerbOneU…
Browse files Browse the repository at this point in the history
…seWeaponAmmoGen

Correct ammo gen for single use weapon with custom verb
  • Loading branch information
N7Huntsman authored Jul 14, 2024
2 parents 01dfc2f + 20e2079 commit 23dc12c
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ private void TryGenerateAmmoFor(ThingWithComps gun, CompInventory inventory, int
var compAmmo = gun.TryGetComp<CompAmmoUser>();
if (compAmmo == null || !compAmmo.UseAmmo)
{
if (gun.TryGetComp<CompEquippable>().PrimaryVerb.verbProps.verbClass == typeof(Verb_ShootCEOneUse))
if (gun.TryGetComp<CompEquippable>().PrimaryVerb.verbProps.verbClass == typeof(Verb_ShootCEOneUse) || (gun.def.weaponTags?.Contains("CE_AmmoGen_Disposable") ?? false))
{
thingToAdd = gun.def; // For one-time use weapons such as grenades, add duplicates instead of ammo
}
Expand Down

0 comments on commit 23dc12c

Please sign in to comment.