more ported bits

This commit is contained in:
Chris Forbes
2010-01-11 17:50:16 +13:00
parent 1c8961e041
commit cf6bb26f83
7 changed files with 14 additions and 14 deletions

View File

@@ -1,6 +1,7 @@
using OpenRa.Game.Traits.Activities;
using System;
using System;
using System.Linq;
using OpenRa.Game.GameRules;
using OpenRa.Game.Traits.Activities;
namespace OpenRa.Game.Traits
{
@@ -17,11 +18,10 @@ namespace OpenRa.Game.Traits
public IDisposable reservation;
public Helicopter(Actor self) {}
// todo: push into data!
static bool HeliCanEnter(Actor a)
{
if (a.LegacyInfo == Rules.UnitInfo["HPAD"]) return true;
if (a.LegacyInfo == Rules.UnitInfo["FIX"]) return true;
if (a.Info.Name == "hpad") return true;
if (a.Info.Name == "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.LegacyInfo.InitialFacing));
self.QueueActivity(new Turn(self.Info.Traits.WithInterface<OwnedActorInfo>().FirstOrDefault().InitialFacing));
self.QueueActivity(new HeliLand(true));
}