#8 hardcoded refs to afld/hpad/fix

This commit is contained in:
Chris Forbes
2010-04-17 10:01:42 +12:00
parent e3ac2a4e88
commit 4b70fa6594
4 changed files with 14 additions and 8 deletions

View File

@@ -19,12 +19,14 @@
#endregion
using System;
using System.Linq;
using OpenRA.Traits.Activities;
namespace OpenRA.Traits
{
class RepairableInfo : ITraitInfo
{
public readonly string[] RepairBuildings = { "fix" };
public object Create(Actor self) { return new Repairable(self); }
}
@@ -38,7 +40,7 @@ namespace OpenRA.Traits
if (mi.Button != MouseButton.Right) return null;
if (underCursor == null) return null;
if (underCursor.Info.Name == "fix"
if (self.Info.Traits.Get<RepairableInfo>().RepairBuildings.Contains(underCursor.Info.Name)
&& underCursor.Owner == self.Owner
&& !Reservable.IsReserved(underCursor))
return new Order("Enter", self, underCursor);