fixes ghosts completely lacking speech (#22157)

This commit is contained in:
deathride58
2023-12-05 16:40:03 -05:00
committed by GitHub
parent 5937d0ca77
commit f0c76348bc
2 changed files with 4 additions and 2 deletions

View File

@@ -187,6 +187,8 @@ namespace Content.Client.Chat.UI
var rawmsg = message.WrappedMessage;
var tagStart = rawmsg.IndexOf($"[{tag}]");
var tagEnd = rawmsg.IndexOf($"[/{tag}]");
if (tagStart <= 0 || tagEnd <= 0) //the above return -1 if the tag's not found, which in turn will cause the below to throw an exception. a blank speech bubble is far more noticeably broken than the bubble not appearing at all -bhijn
return "";
tagStart += tag.Length + 2;
return rawmsg.Substring(tagStart, tagEnd - tagStart);
}