renamed Info to LegacyInfo, marked Obsolete. added NewUnitInfo ref as Info.
This commit is contained in:
@@ -20,8 +20,8 @@ namespace OpenRa.Game.Traits
|
||||
// todo: push into data!
|
||||
static bool HeliCanEnter(Actor a)
|
||||
{
|
||||
if (a.Info == Rules.UnitInfo["HPAD"]) return true;
|
||||
if (a.Info == Rules.UnitInfo["FIX"]) return true;
|
||||
if (a.LegacyInfo == Rules.UnitInfo["HPAD"]) return true;
|
||||
if (a.LegacyInfo == Rules.UnitInfo["FIX"]) return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -52,7 +52,7 @@ namespace OpenRa.Game.Traits
|
||||
{
|
||||
self.CancelActivity();
|
||||
self.QueueActivity(new HeliFly(Util.CenterOfCell(order.TargetLocation)));
|
||||
self.QueueActivity(new Turn(self.Info.InitialFacing));
|
||||
self.QueueActivity(new Turn(self.LegacyInfo.InitialFacing));
|
||||
self.QueueActivity(new HeliLand(true));
|
||||
}
|
||||
|
||||
@@ -63,14 +63,14 @@ namespace OpenRa.Game.Traits
|
||||
if (res != null)
|
||||
reservation = res.Reserve(self);
|
||||
|
||||
var offset = (order.TargetActor.Info as LegacyBuildingInfo).SpawnOffset;
|
||||
var offset = (order.TargetActor.LegacyInfo as LegacyBuildingInfo).SpawnOffset;
|
||||
var offsetVec = offset != null ? new float2(offset[0], offset[1]) : float2.Zero;
|
||||
|
||||
self.CancelActivity();
|
||||
self.QueueActivity(new HeliFly(order.TargetActor.CenterLocation + offsetVec));
|
||||
self.QueueActivity(new Turn(self.Info.InitialFacing));
|
||||
self.QueueActivity(new Turn(self.LegacyInfo.InitialFacing));
|
||||
self.QueueActivity(new HeliLand(false));
|
||||
self.QueueActivity(order.TargetActor.Info == Rules.UnitInfo["HPAD"]
|
||||
self.QueueActivity(order.TargetActor.LegacyInfo == Rules.UnitInfo["HPAD"]
|
||||
? (IActivity)new Rearm() : new Repair());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user