fix(core): Removes implicit cast between Serial and uint (#728)
* Fixes spellbooks using serial ctor * Fixes misc items where someone thought they had an amount and it didn't * Fixes all `Food` types.
This commit is contained in:
parent
17521c9cd7
commit
0dc4acc164
74 changed files with 319 additions and 248 deletions
|
|
@ -10,7 +10,7 @@ namespace Server
|
|||
public const int EquipUpdatePacketLength = 15;
|
||||
public const int RemovePacketLength = 5;
|
||||
|
||||
public static void SendHairEquipUpdatePacket(this NetState ns, Mobile m, Serial hairSerial, int itemId, int hue, Layer layer)
|
||||
public static void SendHairEquipUpdatePacket(this NetState ns, Mobile m, uint hairSerial, int itemId, int hue, Layer layer)
|
||||
{
|
||||
if (ns == null)
|
||||
{
|
||||
|
|
@ -22,7 +22,7 @@ namespace Server
|
|||
ns.Send(buffer);
|
||||
}
|
||||
|
||||
public static void CreateHairEquipUpdatePacket(Span<byte> buffer, Mobile m, Serial hairSerial, int itemId, int hue, Layer layer)
|
||||
public static void CreateHairEquipUpdatePacket(Span<byte> buffer, Mobile m, uint hairSerial, int itemId, int hue, Layer layer)
|
||||
{
|
||||
if (buffer[0] != 0)
|
||||
{
|
||||
|
|
@ -40,7 +40,7 @@ namespace Server
|
|||
writer.Write((short)(m.SolidHueOverride >= 0 ? m.SolidHueOverride : hue));
|
||||
}
|
||||
|
||||
public static void SendRemoveHairPacket(this NetState ns, Serial hairSerial)
|
||||
public static void SendRemoveHairPacket(this NetState ns, uint hairSerial)
|
||||
{
|
||||
if (ns == null)
|
||||
{
|
||||
|
|
@ -52,7 +52,7 @@ namespace Server
|
|||
ns.Send(buffer);
|
||||
}
|
||||
|
||||
public static void CreateRemoveHairPacket(Span<byte> buffer, Serial hairSerial)
|
||||
public static void CreateRemoveHairPacket(Span<byte> buffer, uint hairSerial)
|
||||
{
|
||||
if (buffer[0] != 0)
|
||||
{
|
||||
|
|
@ -121,7 +121,7 @@ namespace Server
|
|||
|
||||
// TODO: Can we make this higher for newer clients?
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static uint FakeSerial(Serial m) => 0x7FFFFFFF - 0x400 - m * 4;
|
||||
public static uint FakeSerial(Serial m) => 0x7FFFFFFF - 0x400 - m.Value * 4;
|
||||
}
|
||||
|
||||
public class FacialHairInfo : BaseHairInfo
|
||||
|
|
@ -143,6 +143,6 @@ namespace Server
|
|||
|
||||
// TODO: Can we make this higher for newer clients?
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static uint FakeSerial(Serial m) => 0x7FFFFFFF - 0x400 - 1 - m * 4;
|
||||
public static uint FakeSerial(Serial m) => 0x7FFFFFFF - 0x400 - 1 - m.Value* 4;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue