move ReserveSpawnBuilding out of Plane.Tick and name it

This commit is contained in:
Chris Forbes
2011-07-17 11:57:07 +12:00
parent 2d8b72a5ff
commit 8b78bc0602
2 changed files with 18 additions and 13 deletions

View File

@@ -33,19 +33,7 @@ namespace OpenRA.Mods.RA.Air
if (firstTick)
{
firstTick = false;
if (self.Trait<IMove>().Altitude == 0)
{
/* not spawning in the air, so try to assoc. with our afld. this is a hack. */
var afld = self.World.FindUnits(self.CenterLocation, self.CenterLocation)
.FirstOrDefault( a => a.HasTrait<Reservable>() );
if (afld != null)
{
var res = afld.Trait<Reservable>();
if (res != null)
reservation = res.Reserve(afld, self, this);
}
}
ReserveSpawnBuilding(self);
}
}