Tidy production exits, cnc only

This commit is contained in:
Paul Chote
2010-09-01 20:22:06 +12:00
parent dca5f8d27b
commit 4e0ace6ec5
7 changed files with 59 additions and 43 deletions

View File

@@ -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),

View File

@@ -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 =>

View File

@@ -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