oops.
This commit is contained in:
@@ -10,13 +10,17 @@ namespace OpenRa.Game.Effects
|
||||
{
|
||||
readonly int2 pos;
|
||||
readonly Animation anim = new Animation("smokey");
|
||||
bool removed;
|
||||
|
||||
public Smoke(int2 pos)
|
||||
{
|
||||
this.pos = pos;
|
||||
anim.PlayThen("idle",
|
||||
() => Game.world.AddFrameEndTask(
|
||||
w => w.Remove(this)));
|
||||
() =>
|
||||
{
|
||||
removed = true;
|
||||
Game.world.AddFrameEndTask(w => w.Remove(this));
|
||||
});
|
||||
}
|
||||
|
||||
public void Tick()
|
||||
@@ -26,7 +30,8 @@ namespace OpenRa.Game.Effects
|
||||
|
||||
public IEnumerable<Tuple<Sprite, float2, int>> Render()
|
||||
{
|
||||
yield return Tuple.New(anim.Image, pos.ToFloat2() - .5f * anim.Image.size, 0);
|
||||
if (!removed)
|
||||
yield return Tuple.New(anim.Image, pos.ToFloat2() - .5f * anim.Image.size, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -607,6 +607,6 @@
|
||||
<sequence name="idle" start="0" length="32" />
|
||||
</unit>
|
||||
<unit name="smokey">
|
||||
<sequence name="idle" start="0" length="6" />
|
||||
<sequence name="idle" start="0" length="7" />
|
||||
</unit>
|
||||
</sequences>
|
||||
Reference in New Issue
Block a user