From faab6e8fd636bce91396f4db6f1b338993573cbd Mon Sep 17 00:00:00 2001 From: andy Date: Tue, 22 Jun 2021 23:22:41 +0000 Subject: [PATCH] append null to avoid message artifacts --- src/packet/ship.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/packet/ship.rs b/src/packet/ship.rs index 27f5fd8..3a1af66 100644 --- a/src/packet/ship.rs +++ b/src/packet/ship.rs @@ -274,7 +274,10 @@ pub struct SmallDialog { } impl SmallDialog { - pub fn new(msg: String) -> SmallDialog { + pub fn new(mut msg: String) -> SmallDialog { + if !msg.ends_with('\0') { + msg.push('\0'); + } SmallDialog { padding: [0; 0x02], msg: msg,