Make ActorPreview and EditorActorPreview wrap ActorReference.

This commit is contained in:
Paul Chote
2020-06-12 13:21:09 +01:00
committed by reaperrr
parent ae7cfa56b7
commit c6c3a8c60d
22 changed files with 265 additions and 162 deletions

View File

@@ -42,14 +42,14 @@ namespace OpenRA.Mods.Common.Traits
}
else
{
var owner = map.PlayerDefinitions.Single(p => s.InitDict.Get<OwnerInit>().InternalName == p.Value.Nodes.Last(k => k.Key == "Name").Value.Value);
var owner = map.PlayerDefinitions.Single(p => s.Get<OwnerInit>().InternalName == p.Value.Nodes.Last(k => k.Key == "Name").Value.Value);
var colorValue = owner.Value.Nodes.Where(n => n.Key == "Color");
var ownerColor = colorValue.Any() ? colorValue.First().Value.Value : "FFFFFF";
Color.TryParse(ownerColor, out color);
}
var ios = ai.TraitInfo<IOccupySpaceInfo>();
var cells = ios.OccupiedCells(ai, s.InitDict.Get<LocationInit>().Value);
var cells = ios.OccupiedCells(ai, s.Get<LocationInit>().Value);
foreach (var cell in cells)
destinationBuffer.Add(new Pair<MPos, Color>(cell.Key.ToMPos(map), color));
}