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:
@@ -67,6 +67,8 @@ namespace OpenRA.Mods.Common.Traits.Render
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
wsb.PlayCustomAnimation(self, info.Sequence, () =>
|
wsb.PlayCustomAnimation(self, info.Sequence, () =>
|
||||||
|
{
|
||||||
|
self.World.AddFrameEndTask(w =>
|
||||||
{
|
{
|
||||||
if (token != ConditionManager.InvalidConditionToken)
|
if (token != ConditionManager.InvalidConditionToken)
|
||||||
token = conditionManager.RevokeCondition(self, token);
|
token = conditionManager.RevokeCondition(self, token);
|
||||||
@@ -74,6 +76,7 @@ namespace OpenRA.Mods.Common.Traits.Render
|
|||||||
// 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();
|
||||||
});
|
});
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Reverse(Actor self, Action onComplete)
|
public void Reverse(Actor self, Action onComplete)
|
||||||
@@ -87,6 +90,8 @@ namespace OpenRA.Mods.Common.Traits.Render
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
wsb.PlayCustomAnimationBackwards(self, info.Sequence, () =>
|
wsb.PlayCustomAnimationBackwards(self, info.Sequence, () =>
|
||||||
|
{
|
||||||
|
self.World.AddFrameEndTask(w =>
|
||||||
{
|
{
|
||||||
if (token != ConditionManager.InvalidConditionToken)
|
if (token != ConditionManager.InvalidConditionToken)
|
||||||
token = conditionManager.RevokeCondition(self, token);
|
token = conditionManager.RevokeCondition(self, token);
|
||||||
@@ -94,6 +99,7 @@ namespace OpenRA.Mods.Common.Traits.Render
|
|||||||
// 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();
|
||||||
});
|
});
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Reverse(Actor self, Activity activity, bool queued = true)
|
public void Reverse(Actor self, Activity activity, bool queued = true)
|
||||||
|
|||||||
Reference in New Issue
Block a user