fix: Don't generate dummy sale entries if no sales are present. (#1471)

- Fixes a bug that's apparently been around for a while that submitted invalid data to Universalis.
This commit is contained in:
KazWolfe 2023-10-05 23:58:04 -07:00 committed by GitHub
parent a7f134b14e
commit 392d9ac884
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -42,10 +42,17 @@ public class MarketBoardHistory
using var stream = new UnmanagedMemoryStream((byte*)dataPtr.ToPointer(), 1544);
using var reader = new BinaryReader(stream);
var output = new MarketBoardHistory();
var output = new MarketBoardHistory
{
CatalogId = reader.ReadUInt32(),
CatalogId2 = reader.ReadUInt32(),
};
output.CatalogId = reader.ReadUInt32();
output.CatalogId2 = reader.ReadUInt32();
if (output.CatalogId2 == 0)
{
// No items found in the resulting packet - just return the empty history.
return output;
}
for (var i = 0; i < 20; i++)
{