Use .Trait<ConditionManager>(); on GrantConditionOnDamageState
This commit is contained in:
committed by
reaperrr
parent
d54e4395e5
commit
ac7d2e00e3
@@ -52,7 +52,7 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
|
|
||||||
void INotifyCreated.Created(Actor self)
|
void INotifyCreated.Created(Actor self)
|
||||||
{
|
{
|
||||||
conditionManager = self.TraitOrDefault<ConditionManager>();
|
conditionManager = self.Trait<ConditionManager>();
|
||||||
GrantConditionOnValidDamageState(self, health.DamageState);
|
GrantConditionOnValidDamageState(self, health.DamageState);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -70,7 +70,7 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
void INotifyDamageStateChanged.DamageStateChanged(Actor self, AttackInfo e)
|
void INotifyDamageStateChanged.DamageStateChanged(Actor self, AttackInfo e)
|
||||||
{
|
{
|
||||||
var granted = conditionToken != ConditionManager.InvalidConditionToken;
|
var granted = conditionToken != ConditionManager.InvalidConditionToken;
|
||||||
if ((granted && info.GrantPermanently) || conditionManager == null)
|
if (granted && info.GrantPermanently)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!granted && !info.ValidDamageStates.HasFlag(e.PreviousDamageState))
|
if (!granted && !info.ValidDamageStates.HasFlag(e.PreviousDamageState))
|
||||||
|
|||||||
Reference in New Issue
Block a user