diff --git a/Dalamud/Game/Gui/NamePlate/NamePlateUpdateHandler.cs b/Dalamud/Game/Gui/NamePlate/NamePlateUpdateHandler.cs
index 565f04846..99429d932 100644
--- a/Dalamud/Game/Gui/NamePlate/NamePlateUpdateHandler.cs
+++ b/Dalamud/Game/Gui/NamePlate/NamePlateUpdateHandler.cs
@@ -273,14 +273,14 @@ public interface INamePlateUpdateHandler
void SetField(NamePlateStringField field, SeString value);
///
- /// Sets the string array value for the provided field.
+ /// Sets the string array value for the provided field. The provided byte sequence must be null-terminated.
///
/// The field to write to.
/// The ReadOnlySpan of bytes to write.
void SetField(NamePlateStringField field, ReadOnlySpan value);
///
- /// Sets the string array value for the provided field.
+ /// Sets the string array value for the provided field. The provided byte sequence must be null-terminated.
///
/// The field to write to.
/// The pointer to a null-terminated sequence of bytes to write.
@@ -550,7 +550,12 @@ internal unsafe class NamePlateUpdateHandler : INamePlateUpdateHandler
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public void SetField(NamePlateStringField field, SeString value)
{
- this.context.StringData->SetValue(this.ArrayIndex + (int)field, value.Encode(), true, true, true);
+ this.context.StringData->SetValue(
+ this.ArrayIndex + (int)field,
+ value.EncodeWithNullTerminator(),
+ true,
+ true,
+ true);
}
///
@@ -601,6 +606,11 @@ internal unsafe class NamePlateUpdateHandler : INamePlateUpdateHandler
{
if ((nint)this.GetFieldAsPointer(field) == NamePlateGui.EmptyStringPointer)
return;
- this.context.StringData->SetValue(this.ArrayIndex + (int)field, value.Encode(), true, true, true);
+ this.context.StringData->SetValue(
+ this.ArrayIndex + (int)field,
+ value.EncodeWithNullTerminator(),
+ true,
+ true,
+ true);
}
}