Some cleanup of contains keys and try get values (#246)

This commit is contained in:
Kamron Batman 2020-09-13 20:20:44 -07:00 • committed by GitHub
parent 9cbb0cfd23
commit a236617ad9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
69 changed files with 3508 additions and 350 deletions

View file

@ -16,7 +16,9 @@ namespace Server.Engines.Craft
CraftItem = item;
if (Recipes.ContainsKey(id))
{
throw new Exception("Attempting to create recipe with preexisting ID.");
}
Recipes.Add(id, this);
LargestRecipeID = Math.Max(id, LargestRecipeID);