Tidy production exits, cnc only
This commit is contained in:
@@ -44,8 +44,8 @@ namespace OpenRA.Mods.RA.Activities
|
||||
if (res != null)
|
||||
self.Trait<Helicopter>().reservation = res.Reserve(self);
|
||||
|
||||
var pi = dest.Trait<Production>();
|
||||
var offset = pi != null ? pi.Spawns.First().First : float2.Zero;
|
||||
var exit = dest.Info.Traits.WithInterface<ExitInfo>().FirstOrDefault();
|
||||
var offset = exit != null ? exit.SpawnOffset : float2.Zero;
|
||||
|
||||
return Util.SequenceActivities(
|
||||
new HeliFly(dest.CenterLocation + offset),
|
||||
|
||||
@@ -104,8 +104,8 @@ namespace OpenRA.Mods.RA
|
||||
if (res != null)
|
||||
reservation = res.Reserve(self);
|
||||
|
||||
var pi = order.TargetActor.Trait<Production>();
|
||||
var offset = pi != null ? pi.Spawns.First().First : float2.Zero;
|
||||
var exit = order.TargetActor.Info.Traits.WithInterface<ExitInfo>().FirstOrDefault();
|
||||
var offset = exit != null ? exit.SpawnOffset : float2.Zero;
|
||||
|
||||
if (self.Owner == self.World.LocalPlayer)
|
||||
self.World.AddFrameEndTask(w =>
|
||||
|
||||
@@ -32,10 +32,10 @@ namespace OpenRA.Mods.RA
|
||||
|
||||
// Pick a spawn/exit point
|
||||
// Todo: Reorder in a synced random way
|
||||
foreach (var s in Spawns)
|
||||
foreach (var s in self.Info.Traits.WithInterface<ExitInfo>())
|
||||
{
|
||||
var exit = self.Location + s.Second;
|
||||
var spawn = self.CenterLocation + s.First;
|
||||
var exit = self.Location + s.ExitCell;
|
||||
var spawn = self.CenterLocation + s.SpawnOffset;
|
||||
if (!self.World.WorldActor.Trait<UnitInfluence>().GetUnitsAt( exit ).Any())
|
||||
{
|
||||
var newUnit = self.World.CreateActor( producee.Name, new TypeDictionary
|
||||
|
||||
Reference in New Issue
Block a user