diff --git a/projects/Gibbed.BorderlandsOz.GameInfo/ItemBalanceDefinition.cs b/projects/Gibbed.BorderlandsOz.GameInfo/ItemBalanceDefinition.cs index a96d808..9641f2e 100644 --- a/projects/Gibbed.BorderlandsOz.GameInfo/ItemBalanceDefinition.cs +++ b/projects/Gibbed.BorderlandsOz.GameInfo/ItemBalanceDefinition.cs @@ -44,14 +44,14 @@ public bool IsSuitableFor(ItemDefinition item) var current = this; do { - if (current.Item != null && current.Item == item) + if (current.Item != null || current.Items?.Count > 0) { - return true; - } + if (current.Item == item || current.Items?.Contains(item) == true) + { + return true; + } - if (current.Items != null && current.Items.Contains(item) == true) - { - return true; + return false; } current = current.Base; @@ -139,11 +139,6 @@ List getList(IEnumerable enumerable) } } - if (result.Item != item && result.Items.Contains(item) == false) - { - throw new ResourceNotFoundException($"item type '{item.ResourcePath}' is not valid for '{this.ResourcePath}'"); - } - return result; } diff --git a/projects/Gibbed.BorderlandsOz.GameInfo/WeaponBalanceDefinition.cs b/projects/Gibbed.BorderlandsOz.GameInfo/WeaponBalanceDefinition.cs index 6332861..07af05a 100644 --- a/projects/Gibbed.BorderlandsOz.GameInfo/WeaponBalanceDefinition.cs +++ b/projects/Gibbed.BorderlandsOz.GameInfo/WeaponBalanceDefinition.cs @@ -123,11 +123,6 @@ public WeaponBalanceDefinition Create(WeaponTypeDefinition weaponType) AddPartList(balance.Parts.MaterialParts, balance.Parts.Mode, result.Parts.MaterialParts); } - if (result.WeaponType != weaponType) - { - throw new ResourceNotFoundException($"weapon type '{weaponType.ResourcePath}' is not valid for '{this.ResourcePath}'"); - } - return result; }