Let CreateGroup use ExtraActors field.

This commit is contained in:
tovl
2019-08-31 13:01:56 +02:00
committed by abcdefg30
parent 00ce1d7ee6
commit 6fb3dc050b
2 changed files with 3 additions and 7 deletions

View File

@@ -11,7 +11,6 @@
using System; using System;
using System.IO; using System.IO;
using System.Linq;
using OpenRA.Network; using OpenRA.Network;
using OpenRA.Traits; using OpenRA.Traits;
@@ -271,7 +270,7 @@ namespace OpenRA
minLength += 4 + 1 + 13 + (TargetString != null ? TargetString.Length + 1 : 0) + 4 + 4 + 4; minLength += 4 + 1 + 13 + (TargetString != null ? TargetString.Length + 1 : 0) + 4 + 4 + 4;
if (ExtraActors != null) if (ExtraActors != null)
minLength += ExtraActors.Count() * 4; minLength += ExtraActors.Length * 4;
// ProtocolVersion.Orders and the associated documentation MUST be updated if the serialized format changes // ProtocolVersion.Orders and the associated documentation MUST be updated if the serialized format changes
var ret = new MemoryStream(minLength); var ret = new MemoryStream(minLength);
@@ -352,7 +351,7 @@ namespace OpenRA
if (fields.HasField(OrderFields.ExtraActors)) if (fields.HasField(OrderFields.ExtraActors))
{ {
w.Write(ExtraActors.Count()); w.Write(ExtraActors.Length);
foreach (var a in ExtraActors) foreach (var a in ExtraActors)
w.Write(UIntFromActor(a)); w.Write(UIntFromActor(a));
} }

View File

@@ -52,10 +52,7 @@ namespace OpenRA.Orders
// HACK: This is required by the hacky player actions-per-minute calculation // HACK: This is required by the hacky player actions-per-minute calculation
// TODO: Reimplement APM properly and then remove this // TODO: Reimplement APM properly and then remove this
yield return new Order("CreateGroup", actorsInvolved.First().Owner.PlayerActor, false) yield return new Order("CreateGroup", actorsInvolved.First().Owner.PlayerActor, false, actorsInvolved.ToArray());
{
TargetString = actorsInvolved.Select(a => a.ActorID).JoinWith(",")
};
foreach (var o in orders) foreach (var o in orders)
yield return CheckSameOrder(o.Order, o.Trait.IssueOrder(o.Actor, o.Order, o.Target, mi.Modifiers.HasModifier(Modifiers.Shift))); yield return CheckSameOrder(o.Order, o.Trait.IssueOrder(o.Actor, o.Order, o.Target, mi.Modifiers.HasModifier(Modifiers.Shift)));