Skip to content

Commit

Permalink
Restore weapon type/item balance checking that was inadvertently remo…
Browse files Browse the repository at this point in the history
…ved in previous commit.
  • Loading branch information
gibbed committed Jun 24, 2019
1 parent 444d39c commit 75677cd
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,11 @@ List<string> getList(IEnumerable<string> 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;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,11 @@ 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;
}

Expand Down

0 comments on commit 75677cd

Please sign in to comment.