diff --git a/src/NosCore.Packets/ServerPackets/Inventory/EInfoNpcMonsterPacket.cs b/src/NosCore.Packets/ServerPackets/Inventory/EInfoNpcMonsterPacket.cs index 62af08e..db567cb 100644 --- a/src/NosCore.Packets/ServerPackets/Inventory/EInfoNpcMonsterPacket.cs +++ b/src/NosCore.Packets/ServerPackets/Inventory/EInfoNpcMonsterPacket.cs @@ -92,7 +92,7 @@ public class EInfoNpcMonsterPacket : PacketBase [PacketIndex(24)] public int Unknown { get; set; } = -1; - [PacketIndex(25)] + [PacketIndex(25, EscapeSpaces = true)] public string? Name { get; set; } } } diff --git a/test/NosCore.Packets.Tests/StringFieldSeparatorTests.cs b/test/NosCore.Packets.Tests/StringFieldSeparatorTests.cs index 75973a0..248aaf7 100644 --- a/test/NosCore.Packets.Tests/StringFieldSeparatorTests.cs +++ b/test/NosCore.Packets.Tests/StringFieldSeparatorTests.cs @@ -10,6 +10,7 @@ using NosCore.Packets.Interfaces; using NosCore.Packets.ServerPackets.Mates; using NosCore.Packets.ServerPackets.Groups; +using NosCore.Packets.ServerPackets.Inventory; using NosCore.Packets.ServerPackets.Miniland; using NosCore.Packets.ServerPackets.Visibility; using System.Collections.Generic; @@ -42,7 +43,8 @@ public class StringFieldSeparatorTests { typeof(SeparatorProbePacket), typeof(DottedProbePacket), typeof(ScpPacket), typeof(ScnPacket), typeof(InPacket), - typeof(PinitPacket), typeof(MlintroPacket), typeof(MlInfoBrPacket) + typeof(PinitPacket), typeof(MlintroPacket), typeof(MlInfoBrPacket), + typeof(EInfoNpcMonsterPacket) }); [TestMethod] @@ -118,6 +120,10 @@ public void AFieldThatOptsInIsEscapedEvenThoughItIsLast() StringAssert.Contains( Serializer.Serialize(new MlInfoBrPacket { Name = "Bob", MinilandMessage = "hello there" }), "hello^there"); + + StringAssert.Contains( + Serializer.Serialize(new EInfoNpcMonsterPacket { Name = "Mother Cuby" }), + "Mother^Cuby"); } [TestMethod]