add IHasLocation

This commit is contained in:
Bob
2010-09-26 17:58:25 +12:00
parent 911db3feb1
commit 699b4b1154
31 changed files with 136 additions and 105 deletions

View File

@@ -35,7 +35,7 @@ namespace OpenRA.Mods.RA
foreach (var s in self.Info.Traits.WithInterface<ExitInfo>())
{
var exit = self.Location + s.ExitCell;
var spawn = self.CenterLocation + s.SpawnOffset;
var spawn = self.Trait<IHasLocation>().PxPosition + s.SpawnOffset;
if (!self.World.WorldActor.Trait<UnitInfluence>().GetUnitsAt( exit ).Any())
{
var newUnit = self.World.CreateActor( producee.Name, new TypeDictionary
@@ -43,8 +43,7 @@ namespace OpenRA.Mods.RA
new LocationInit( exit ),
new OwnerInit( self.Owner ),
});
newUnit.CenterLocation = spawn;
var rp = self.TraitOrDefault<RallyPoint>();
if( rp != null )
{