Allow queued structure rallypoints.
This commit is contained in:
@@ -10,6 +10,7 @@
|
||||
#endregion
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using OpenRA.Mods.Common.Activities;
|
||||
using OpenRA.Primitives;
|
||||
using OpenRA.Traits;
|
||||
@@ -42,7 +43,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
public virtual void DoProduction(Actor self, ActorInfo producee, ExitInfo exitinfo, string productionType, TypeDictionary inits)
|
||||
{
|
||||
var exit = CPos.Zero;
|
||||
var exitLocation = CPos.Zero;
|
||||
var exitLocations = new List<CPos>();
|
||||
|
||||
// Clone the initializer dictionary for the new actor
|
||||
var td = new TypeDictionary();
|
||||
@@ -68,7 +69,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
initialFacing = delta.Yaw.Facing;
|
||||
}
|
||||
|
||||
exitLocation = rp.Value != null ? rp.Value.Location : exit;
|
||||
exitLocations = rp.Value != null ? rp.Value.Path : new List<CPos> { exit };
|
||||
|
||||
td.Add(new LocationInit(exit));
|
||||
td.Add(new CenterPositionInit(spawn));
|
||||
@@ -83,7 +84,8 @@ namespace OpenRA.Mods.Common.Traits
|
||||
|
||||
var move = newUnit.TraitOrDefault<IMove>();
|
||||
if (exitinfo != null && move != null)
|
||||
newUnit.QueueActivity(new AttackMoveActivity(newUnit, () => move.MoveTo(exitLocation, 1, targetLineColor: Color.OrangeRed)));
|
||||
foreach (var cell in exitLocations)
|
||||
newUnit.QueueActivity(new AttackMoveActivity(newUnit, () => move.MoveTo(cell, 1, evaluateNearestMovableCell: true, targetLineColor: Color.OrangeRed)));
|
||||
|
||||
if (!self.IsDead)
|
||||
foreach (var t in self.TraitsImplementing<INotifyProduction>())
|
||||
|
||||
Reference in New Issue
Block a user