Fix a glitch in WithBuildingPlacedOverlay

when transforming the actor.
This commit is contained in:
abcdefg30
2015-02-18 11:15:11 +01:00
parent 035b96f469
commit f63bc1e001

View File

@@ -33,7 +33,7 @@ namespace OpenRA.Mods.D2k.Traits
public object Create(ActorInitializer init) { return new WithBuildingPlacedOverlay(init.Self, this); }
}
public class WithBuildingPlacedOverlay : INotifyBuildComplete, INotifySold, INotifyDamageStateChanged, INotifyBuildingPlaced
public class WithBuildingPlacedOverlay : INotifyBuildComplete, INotifySold, INotifyDamageStateChanged, INotifyBuildingPlaced, INotifyTransform
{
Animation overlay;
bool buildComplete;
@@ -65,6 +65,14 @@ namespace OpenRA.Mods.D2k.Traits
buildComplete = false;
}
public void BeforeTransform(Actor self)
{
buildComplete = false;
}
public void OnTransform(Actor self) { }
public void AfterTransform(Actor self) { }
public void DamageStateChanged(Actor self, AttackInfo e)
{
overlay.ReplaceAnim(RenderSprites.NormalizeSequence(overlay, e.DamageState, overlay.CurrentSequence.Name));