Remove ContrailFader when complete. Fixes #4302.
This commit is contained in:
@@ -15,6 +15,8 @@ namespace OpenRA.Graphics
|
||||
{
|
||||
public struct ContrailRenderable : IRenderable
|
||||
{
|
||||
public int Length { get { return trail.Length; } }
|
||||
|
||||
readonly World world;
|
||||
|
||||
// Store trail positions in a circular buffer
|
||||
|
||||
@@ -18,6 +18,7 @@ namespace OpenRA.Mods.RA.Effects
|
||||
{
|
||||
WPos pos;
|
||||
ContrailRenderable trail;
|
||||
int ticks;
|
||||
|
||||
public ContrailFader(WPos pos, ContrailRenderable trail)
|
||||
{
|
||||
@@ -27,6 +28,9 @@ namespace OpenRA.Mods.RA.Effects
|
||||
|
||||
public void Tick(World world)
|
||||
{
|
||||
if (ticks++ == trail.Length)
|
||||
world.AddFrameEndTask(w => w.Remove(this));
|
||||
|
||||
trail.Update(pos);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user