Revert "Updates Packets & Randomizer (#43)" (#61)

This reverts commit 179cb50557.
This commit is contained in:
Kamron Batman 2019-11-11 08:46:11 -08:00 • committed by GitHub
parent 179cb50557
commit c2ecc76457
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
588 changed files with 16260 additions and 10926 deletions

View file

@ -484,7 +484,8 @@ namespace Server.Engines.Craft
if (m_TypesTable[j][0] == baseType)
types[i] = m_TypesTable[j];
types[i] ??= new[] { baseType };
if (types[i] == null)
types[i] = new[] { baseType };
amounts[i] = craftRes.Amount;
@ -909,7 +910,8 @@ namespace Server.Engines.Craft
hammer.Delete();
}
toolBroken |= tool.UsesRemaining < 1 && tool.BreakOnDepletion;
if (tool.UsesRemaining < 1 && tool.BreakOnDepletion)
toolBroken = true;
if (toolBroken)
tool.Delete();
@ -1031,7 +1033,8 @@ namespace Server.Engines.Craft
tool.UsesRemaining--;
toolBroken |= tool.UsesRemaining < 1 && tool.BreakOnDepletion;
if (tool.UsesRemaining < 1 && tool.BreakOnDepletion)
toolBroken = true;
if (toolBroken)
tool.Delete();

View file

@ -33,7 +33,7 @@ namespace Server.Engines.Craft
public int ID{ get; }
public TextDefinition TextDefinition => m_TD ??= new TextDefinition(CraftItem.NameNumber, CraftItem.NameString);
public TextDefinition TextDefinition => m_TD ?? (m_TD = new TextDefinition(CraftItem.NameNumber, CraftItem.NameString));
public static void Initialize()
{
@ -52,13 +52,15 @@ namespace Server.Engines.Craft
{
if (targeted is PlayerMobile mobile)
{
foreach (var (key, _) in Recipes)
mobile.AcquireRecipe(key);
foreach (KeyValuePair<int, Recipe> kvp in Recipes)
mobile.AcquireRecipe(kvp.Key);
m.SendMessage("You teach them all of the recipes.");
}
else
{
m.SendMessage("That is not a player!");
}
});
}
@ -84,4 +86,4 @@ namespace Server.Engines.Craft
});
}
}
}
}

View file

@ -491,7 +491,7 @@ namespace Server.Engines.Craft
if (!usingDeed)
{
m_CraftSystem.GetContext(from);
CraftContext context = m_CraftSystem.GetContext(from);
from.SendGump(new CraftGump(from, m_CraftSystem, m_Tool, number));
}
else
@ -504,4 +504,4 @@ namespace Server.Engines.Craft
}
}
}
}
}