Skip to content

Commit

Permalink
Don't use Linq to load checksum from map files
Browse files Browse the repository at this point in the history
  • Loading branch information
ethanmoffat committed May 28, 2024
1 parent 057b31a commit 695a0af
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion EOLib.IO/Services/Serializers/MapPropertiesSerializer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using System.Text;
using AutomaticTypeMapper;
using EOLib.IO.Map;
using Moffat.EndlessOnline.SDK.Data;

namespace EOLib.IO.Services.Serializers
{
Expand Down Expand Up @@ -59,7 +60,11 @@ public IMapFileProperties DeserializeFromByteArray(byte[] data)
if (typeString != properties.FileType)
throw new FormatException("Data is not correctly formatted! Must be an EMF file header");

var checksumArray = data.Skip(3).Take(4).Cast<int>().ToList();
var checksumArray = new List<int>
{
NumberEncoder.DecodeNumber(new byte[] { data[3], data[4] }),
NumberEncoder.DecodeNumber(new byte[] { data[5], data[6] }),
};
var mapNameArray = data.Skip(7).Take(24).ToArray();
var mapName = _mapStringEncoderService.DecodeMapString(mapNameArray);

Expand Down

0 comments on commit 695a0af

Please sign in to comment.