Skip to content
This repository has been archived by the owner on Apr 14, 2020. It is now read-only.

Commit

Permalink
Merge pull request #1040 from CombatExtendedRWMod/Fix-for-#1038
Browse files Browse the repository at this point in the history
Fix for #1038 (generateAllowChance instead of generateCommonality)
  • Loading branch information
zozilin authored Feb 22, 2020
2 parents 9521fc9 + 8ecdabc commit d90a068
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,8 @@ private void LoadWeaponWithRandAmmo(ThingWithComps gun)
return;
}
// Determine ammo
IEnumerable<AmmoDef> availableAmmo = compAmmo.Props.ammoSet.ammoTypes.Where(a => a.ammo.alwaysHaulable).Select(a => a.ammo); //Running out of options. alwaysHaulable does exist in xml.
AmmoDef ammoToLoad = availableAmmo.RandomElementByWeight(a => a.generateCommonality);
IEnumerable<AmmoDef> availableAmmo = compAmmo.Props.ammoSet.ammoTypes.Where(a => a.ammo.alwaysHaulable && a.ammo.generateAllowChance > 0f).Select(a => a.ammo); //Running out of options. alwaysHaulable does exist in xml.
AmmoDef ammoToLoad = availableAmmo.RandomElementByWeight(a => a.generateAllowChance);
compAmmo.ResetAmmoCount(ammoToLoad);
}

Expand Down

0 comments on commit d90a068

Please sign in to comment.