From 469a393585446bdb56018d613e7b6e3b4f61f9c1 Mon Sep 17 00:00:00 2001 From: Chris Forbes Date: Sat, 3 Mar 2012 18:01:50 +1300 Subject: [PATCH] give RepairableNear access to its info --- OpenRA.Mods.RA/RepairableNear.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/OpenRA.Mods.RA/RepairableNear.cs b/OpenRA.Mods.RA/RepairableNear.cs index 89204f1501..534243a919 100644 --- a/OpenRA.Mods.RA/RepairableNear.cs +++ b/OpenRA.Mods.RA/RepairableNear.cs @@ -23,14 +23,15 @@ namespace OpenRA.Mods.RA { [ActorReference] public readonly string[] Buildings = { "spen", "syrd" }; - public object Create( ActorInitializer init ) { return new RepairableNear( init.self ); } + public object Create( ActorInitializer init ) { return new RepairableNear( init.self, this ); } } class RepairableNear : IIssueOrder, IResolveOrder { readonly Actor self; + readonly RepairableNearInfo info; - public RepairableNear( Actor self ) { this.self = self; } + public RepairableNear( Actor self, RepairableNearInfo info ) { this.self = self; this.info = info; } public IEnumerable Orders { @@ -51,7 +52,7 @@ namespace OpenRA.Mods.RA bool CanRepairAt( Actor target ) { - return self.Info.Traits.Get().Buildings.Contains( target.Info.Name ); + return info.Buildings.Contains( target.Info.Name ); } bool ShouldRepair()