Merge pull request #5817 from Mailaender/chat-command-nre
Fixed chat commands crashing replays
This commit is contained in:
@@ -67,7 +67,11 @@ namespace OpenRA.Mods.RA.Widgets.Logic
|
|||||||
{
|
{
|
||||||
var team = teamChat && !disableTeamChat;
|
var team = teamChat && !disableTeamChat;
|
||||||
if (chatText.Text != "")
|
if (chatText.Text != "")
|
||||||
|
if (!chatText.Text.StartsWith("/"))
|
||||||
orderManager.IssueOrder(Order.Chat(team, chatText.Text.Trim()));
|
orderManager.IssueOrder(Order.Chat(team, chatText.Text.Trim()));
|
||||||
|
else
|
||||||
|
if (chatTraits != null)
|
||||||
|
chatTraits.All(x => x.OnChat(orderManager.LocalClient.Name, chatText.Text.Trim()));
|
||||||
|
|
||||||
CloseChat();
|
CloseChat();
|
||||||
return true;
|
return true;
|
||||||
@@ -126,9 +130,6 @@ namespace OpenRA.Mods.RA.Widgets.Logic
|
|||||||
|
|
||||||
public void AddChatLine(Color c, string from, string text)
|
public void AddChatLine(Color c, string from, string text)
|
||||||
{
|
{
|
||||||
if (chatTraits != null && !chatTraits.All(x => x.OnChat(from, text)))
|
|
||||||
return;
|
|
||||||
|
|
||||||
chatOverlayDisplay.AddLine(c, from, text);
|
chatOverlayDisplay.AddLine(c, from, text);
|
||||||
|
|
||||||
var template = chatTemplate.Clone();
|
var template = chatTemplate.Clone();
|
||||||
|
|||||||
Reference in New Issue
Block a user