Send the designated team number as extra data in the order
This commit is contained in:
@@ -124,7 +124,14 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
||||
if (chatText.Text != "")
|
||||
{
|
||||
if (!chatText.Text.StartsWith("/", StringComparison.Ordinal))
|
||||
orderManager.IssueOrder(Order.Chat(team, chatText.Text.Trim()));
|
||||
{
|
||||
// This should never happen, but avoid a crash if it does somehow (chat will just stay open)
|
||||
if (!isObserver && orderManager.LocalClient == null && world.LocalPlayer == null)
|
||||
return true;
|
||||
|
||||
var teamNumber = (isObserver || world.LocalPlayer.WinState != WinState.Undefined) ? 0 : orderManager.LocalClient.Team;
|
||||
orderManager.IssueOrder(Order.Chat(team, chatText.Text.Trim(), teamNumber));
|
||||
}
|
||||
else if (chatTraits != null)
|
||||
{
|
||||
var text = chatText.Text.Trim();
|
||||
|
||||
@@ -402,7 +402,11 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
||||
// Always scroll to bottom when we've typed something
|
||||
lobbyChatPanel.ScrollToBottom();
|
||||
|
||||
orderManager.IssueOrder(Order.Chat(teamChat, chatTextField.Text));
|
||||
var teamNumber = 0;
|
||||
if (teamChat && orderManager.LocalClient != null && !orderManager.LocalClient.IsObserver)
|
||||
teamNumber = orderManager.LocalClient.Team;
|
||||
|
||||
orderManager.IssueOrder(Order.Chat(teamChat, chatTextField.Text, teamNumber));
|
||||
chatTextField.Text = "";
|
||||
return true;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user