This commit is contained in:
Chris Forbes
2010-01-11 19:07:22 +13:00
parent 21bf3cd0e1
commit 5faa1ea724
9 changed files with 20 additions and 14 deletions

View File

@@ -24,9 +24,11 @@ namespace OpenRa.Game.Traits.Activities
if (isCanceled) return NextActivity;
var dest = ChooseHelipad(self);
var initialFacing = self.Info.Traits.WithInterface<OwnedActorInfo>().First().InitialFacing;
if (dest == null)
return Util.SequenceActivities(
new Turn(self.LegacyInfo.InitialFacing),
new Turn(initialFacing),
new HeliLand(true),
NextActivity);
@@ -34,12 +36,13 @@ namespace OpenRa.Game.Traits.Activities
if (res != null)
self.traits.Get<Helicopter>().reservation = res.Reserve(self);
var offset = (dest.LegacyInfo as LegacyBuildingInfo).SpawnOffset;
var pi = dest.Info.Traits.GetOrDefault<ProductionInfo>();
var offset = pi != null ? pi.SpawnOffset : null;
var offsetVec = offset != null ? new float2(offset[0], offset[1]) : float2.Zero;
return Util.SequenceActivities(
new HeliFly(dest.CenterLocation + offsetVec),
new Turn(self.LegacyInfo.InitialFacing),
new Turn(initialFacing),
new HeliLand(false),
new Rearm(),
NextActivity);

View File

@@ -31,6 +31,7 @@ namespace OpenRa.Game.Traits
public readonly string[] Produces = { }; // does this go somewhere else?
public readonly int2 Dimensions = new int2(1, 1);
public readonly bool WaterBound = false;
public readonly bool Unsellable = false;
public object Create(Actor self) { return new Building(self); }
}

View File

@@ -21,7 +21,7 @@ namespace OpenRa.Game.Traits
if (mi.Button != MouseButton.Right) return null;
if (underCursor == null) return null;
if (underCursor.LegacyInfo == Rules.UnitInfo["FIX"]
if (underCursor.Info.Name == "fix"
&& underCursor.Owner == self.Owner
&& !Reservable.IsReserved(underCursor))
return new Order("Enter", self, underCursor, int2.Zero, null);