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
|
|
@ -43,7 +43,7 @@ namespace UOContent.Tests
|
|||
|
||||
var list = new List<IEntity> { item1, beholder.Object };
|
||||
var notContained = new List<IEntity> { item2 };
|
||||
var boat = new TestBoat(0x3000, list, notContained)
|
||||
var boat = new TestBoat((Serial)0x3000, list, notContained)
|
||||
{
|
||||
Location = new Point3D(10, 20, 15),
|
||||
Facing = Direction.Right,
|
||||
|
|
@ -87,7 +87,7 @@ namespace UOContent.Tests
|
|||
|
||||
var list = new List<IEntity> { item1, beholder.Object };
|
||||
var notContained = new List<IEntity> { item2 };
|
||||
var boat = new TestBoat(0x3000, list, notContained)
|
||||
var boat = new TestBoat((Serial)0x3000, list, notContained)
|
||||
{
|
||||
Location = new Point3D(10, 20, 15),
|
||||
Facing = Direction.Right
|
||||
|
|
|
|||
|
|
@ -15,10 +15,10 @@ namespace UOContent.Tests
|
|||
[InlineData(0x1001u)]
|
||||
public void TestBeginHouseCustomization(uint serial)
|
||||
{
|
||||
var expected = new BeginHouseCustomization(serial).Compile();
|
||||
var expected = new BeginHouseCustomization((Serial)serial).Compile();
|
||||
|
||||
var ns = PacketTestUtilities.CreateTestNetState();
|
||||
ns.SendBeginHouseCustomization(serial);
|
||||
ns.SendBeginHouseCustomization((Serial)serial);
|
||||
|
||||
var result = ns.SendPipe.Reader.TryRead();
|
||||
AssertThat.Equal(result.Buffer[0].AsSpan(0), expected);
|
||||
|
|
@ -28,10 +28,10 @@ namespace UOContent.Tests
|
|||
[InlineData(0x1001u)]
|
||||
public void TestEndHouseCustomization(uint serial)
|
||||
{
|
||||
var expected = new EndHouseCustomization(serial).Compile();
|
||||
var expected = new EndHouseCustomization((Serial)serial).Compile();
|
||||
|
||||
var ns = PacketTestUtilities.CreateTestNetState();
|
||||
ns.SendEndHouseCustomization(serial);
|
||||
ns.SendEndHouseCustomization((Serial)serial);
|
||||
|
||||
var result = ns.SendPipe.Reader.TryRead();
|
||||
AssertThat.Equal(result.Buffer[0].AsSpan(0), expected);
|
||||
|
|
@ -42,10 +42,10 @@ namespace UOContent.Tests
|
|||
[InlineData(0x1001u, 100)]
|
||||
public void TestDesignStateGeneral(uint serial, int revision)
|
||||
{
|
||||
var expected = new DesignStateGeneral(serial, revision).Compile();
|
||||
var expected = new DesignStateGeneral((Serial)serial, revision).Compile();
|
||||
|
||||
var ns = PacketTestUtilities.CreateTestNetState();
|
||||
ns.SendDesignStateGeneral(serial, revision);
|
||||
ns.SendDesignStateGeneral((Serial)serial, revision);
|
||||
|
||||
var result = ns.SendPipe.Reader.TryRead();
|
||||
AssertThat.Equal(result.Buffer[0].AsSpan(0), expected);
|
||||
|
|
@ -54,7 +54,7 @@ namespace UOContent.Tests
|
|||
[Fact]
|
||||
public void TestHouseDesignStateDetailed()
|
||||
{
|
||||
Serial serial = 0x40000001;
|
||||
Serial serial = (Serial)0x40000001;
|
||||
var revision = 10;
|
||||
var tiles = new MultiTileEntry[250];
|
||||
for (var i = 0; i < tiles.Length; i++)
|
||||
|
|
|
|||
|
|
@ -56,14 +56,14 @@ namespace Server.Network
|
|||
private readonly bool[] m_PlaneUsed = new bool[9];
|
||||
private readonly byte[] m_PrimBuffer = new byte[4];
|
||||
|
||||
public DesignStateDetailed(uint serial, int revision, int xMin, int yMin, int xMax, int yMax, MultiTileEntry[] tiles)
|
||||
public DesignStateDetailed(Serial serial, int revision, int xMin, int yMin, int xMax, int yMax, MultiTileEntry[] tiles)
|
||||
: base(0xD8)
|
||||
{
|
||||
EnsureCapacity(17 + tiles.Length * 5);
|
||||
|
||||
Write((byte)0x03); // Compression Type
|
||||
Write((byte)0x00); // Unknown
|
||||
Write(serial);
|
||||
Write(serial.Value);
|
||||
Write(revision);
|
||||
Write((short)tiles.Length);
|
||||
Write((short)0); // Buffer length : reserved
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue