Skip to content

Commit

Permalink
Merge pull request #2867 from CombatExtended-Continued/vfammo
Browse files Browse the repository at this point in the history
always replace vehicle ammunition ThingFilter
  • Loading branch information
N7Huntsman authored Nov 4, 2023
2 parents 8940202 + d596e85 commit 40a6608
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions Source/VehiclesCompat/VehiclesCompat/VehiclesCompat.cs
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,17 @@ public static IEnumerable<ThingDef> _GetUsedAmmo()
if (asd != null)
{
cetddme._ammoSet = asd;
HashSet<ThingDef> allowedAmmo = (HashSet<ThingDef>)vtd.ammunition?.AllowedThingDefs;
allowedAmmo.Clear();
var ammunition = vtd.ammunition = new ThingFilter();
vtd.genericAmmo = false;
HashSet<ThingDef> allowedAmmo = (HashSet<ThingDef>)ammunition.AllowedThingDefs;

foreach (var al in asd.ammoTypes)
{
allowedAmmo.Add(al.ammo);
yield return al.ammo;
}

vtd.ammunition.ResolveReferences();
}
}
}
Expand Down

0 comments on commit 40a6608

Please sign in to comment.