Revoke WithMakeAnimation condition at the end of the tick.
This fixes traits becoming enabled for a tick between the animation completing and the actor being removed from the world.
This commit is contained in:
@@ -68,11 +68,14 @@ namespace OpenRA.Mods.Common.Traits.Render
|
|||||||
|
|
||||||
wsb.PlayCustomAnimation(self, info.Sequence, () =>
|
wsb.PlayCustomAnimation(self, info.Sequence, () =>
|
||||||
{
|
{
|
||||||
if (token != ConditionManager.InvalidConditionToken)
|
self.World.AddFrameEndTask(w =>
|
||||||
token = conditionManager.RevokeCondition(self, token);
|
{
|
||||||
|
if (token != ConditionManager.InvalidConditionToken)
|
||||||
|
token = conditionManager.RevokeCondition(self, token);
|
||||||
|
|
||||||
// TODO: Rewrite this to use a trait notification for save game support
|
// TODO: Rewrite this to use a trait notification for save game support
|
||||||
onComplete();
|
onComplete();
|
||||||
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -88,11 +91,14 @@ namespace OpenRA.Mods.Common.Traits.Render
|
|||||||
|
|
||||||
wsb.PlayCustomAnimationBackwards(self, info.Sequence, () =>
|
wsb.PlayCustomAnimationBackwards(self, info.Sequence, () =>
|
||||||
{
|
{
|
||||||
if (token != ConditionManager.InvalidConditionToken)
|
self.World.AddFrameEndTask(w =>
|
||||||
token = conditionManager.RevokeCondition(self, token);
|
{
|
||||||
|
if (token != ConditionManager.InvalidConditionToken)
|
||||||
|
token = conditionManager.RevokeCondition(self, token);
|
||||||
|
|
||||||
// TODO: Rewrite this to use a trait notification for save game support
|
// TODO: Rewrite this to use a trait notification for save game support
|
||||||
onComplete();
|
onComplete();
|
||||||
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user