Fix UncloakOn: Damage only working when the damage state changes

This commit is contained in:
abcdefg30
2016-10-03 14:35:38 +02:00
parent 5acbe91221
commit d57c476eaa

View File

@@ -60,7 +60,7 @@ namespace OpenRA.Mods.Common.Traits
public override object Create(ActorInitializer init) { return new Cloak(this); } public override object Create(ActorInitializer init) { return new Cloak(this); }
} }
public class Cloak : UpgradableTrait<CloakInfo>, IRenderModifier, INotifyDamageStateChanged, public class Cloak : UpgradableTrait<CloakInfo>, IRenderModifier, INotifyDamage,
INotifyAttack, ITick, IVisibilityModifier, IRadarColorModifier, INotifyCreated, INotifyHarvesterAction INotifyAttack, ITick, IVisibilityModifier, IRadarColorModifier, INotifyCreated, INotifyHarvesterAction
{ {
[Sync] int remainingTime; [Sync] int remainingTime;
@@ -100,7 +100,7 @@ namespace OpenRA.Mods.Common.Traits
void INotifyAttack.PreparingAttack(Actor self, Target target, Armament a, Barrel barrel) { } void INotifyAttack.PreparingAttack(Actor self, Target target, Armament a, Barrel barrel) { }
void INotifyDamageStateChanged.DamageStateChanged(Actor self, AttackInfo e) void INotifyDamage.Damaged(Actor self, AttackInfo e)
{ {
damageDisabled = e.DamageState >= DamageState.Critical; damageDisabled = e.DamageState >= DamageState.Critical;
if (damageDisabled || Info.UncloakOn.HasFlag(UncloakType.Damage)) if (damageDisabled || Info.UncloakOn.HasFlag(UncloakType.Damage))