Actor.traits is implementation detail
This commit is contained in:
@@ -6,12 +6,12 @@
|
||||
* as published by the Free Software Foundation. For more information,
|
||||
* see LICENSE.
|
||||
*/
|
||||
#endregion
|
||||
|
||||
using System.Drawing;
|
||||
using OpenRA.Effects;
|
||||
using OpenRA.Mods.RA.Activities;
|
||||
using OpenRA.Traits;
|
||||
#endregion
|
||||
|
||||
using System.Drawing;
|
||||
using OpenRA.Effects;
|
||||
using OpenRA.Mods.RA.Activities;
|
||||
using OpenRA.Traits;
|
||||
using OpenRA.Traits.Activities;
|
||||
|
||||
namespace OpenRA.Mods.RA
|
||||
@@ -31,7 +31,7 @@ namespace OpenRA.Mods.RA
|
||||
|
||||
bool CanRepair(Actor self, Actor a)
|
||||
{
|
||||
if (!a.traits.Contains<Building>()) return false;
|
||||
if (!a.HasTrait<Building>()) return false;
|
||||
return (self.Owner.Stances[a.Owner] == Stance.Ally);
|
||||
}
|
||||
|
||||
@@ -57,7 +57,7 @@ namespace OpenRA.Mods.RA
|
||||
self.World.AddFrameEndTask(w =>
|
||||
{
|
||||
w.Add(new FlashTarget(order.TargetActor));
|
||||
var line = self.traits.GetOrDefault<DrawLineToTarget>();
|
||||
var line = self.TraitOrDefault<DrawLineToTarget>();
|
||||
if (line != null)
|
||||
line.SetTarget(self, Target.FromOrder(order), Color.Yellow);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user