fix(recipes): Fixes NPE with recipes on PlayerMobile (#476)

This commit is contained in:
Kamron Batman 2021-02-06 21:07:59 -08:00 committed by GitHub
parent bd87035f12
commit 76035f6bd1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -4561,7 +4561,8 @@ namespace Server.Mobiles
public virtual bool HasRecipe(Recipe r) => r != null && HasRecipe(r.ID);
public virtual bool HasRecipe(int recipeID) => m_AcquiredRecipes.TryGetValue(recipeID, out var value) && value;
public virtual bool HasRecipe(int recipeID) =>
m_AcquiredRecipes != null && m_AcquiredRecipes.TryGetValue(recipeID, out var value) && value;
public virtual void AcquireRecipe(Recipe r)
{
@ -4574,7 +4575,6 @@ namespace Server.Mobiles
public virtual void AcquireRecipe(int recipeID)
{
m_AcquiredRecipes ??= new Dictionary<int, bool>();
m_AcquiredRecipes[recipeID] = true;
}