Add a method to look up actors by ID.
This can be used to speed up some methods.
This commit is contained in:
@@ -26,7 +26,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
/* create a group */
|
||||
var actors = order.TargetString.Split(',')
|
||||
.Select(id => uint.Parse(id, NumberStyles.Any, NumberFormatInfo.InvariantInfo))
|
||||
.Select(id => self.World.Actors.FirstOrDefault(a => a.ActorID == id))
|
||||
.Select(id => self.World.GetActorById(id))
|
||||
.Where(a => a != null);
|
||||
|
||||
new Group(actors);
|
||||
|
||||
Reference in New Issue
Block a user