Stance modification for engineer repair

This commit is contained in:
entropai
2016-10-16 13:14:58 +03:00
committed by reaperrr
parent 285e9a8030
commit 57e5bbb448
2 changed files with 11 additions and 2 deletions

View File

@@ -18,11 +18,13 @@ namespace OpenRA.Mods.Common.Activities
{
readonly Actor target;
readonly Health health;
readonly Stance validStances;
public RepairBuilding(Actor self, Actor target, EnterBehaviour enterBehaviour)
public RepairBuilding(Actor self, Actor target, EnterBehaviour enterBehaviour, Stance validStances)
: base(self, target, enterBehaviour)
{
this.target = target;
this.validStances = validStances;
health = target.Trait<Health>();
}
@@ -33,6 +35,10 @@ namespace OpenRA.Mods.Common.Activities
protected override void OnInside(Actor self)
{
var stance = self.Owner.Stances[target.Owner];
if (!stance.HasStance(validStances))
return;
if (health.DamageState == DamageState.Undamaged)
return;