Skip to content

Commit c124d4c

Browse files
authored
Merge pull request phaserjs#5467 from rexrainbow/improve-postfx-pipeline
Remove a type of Post Pipeline instances, not only a single instance
2 parents 603acf0 + 60c4201 commit c124d4c

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

src/gameobjects/components/Pipeline.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ var Pipeline = {
359359
},
360360

361361
/**
362-
* Removes a single Post Pipeline instance from this Game Object, based on the given name, and destroys it.
362+
* Removes a type of Post Pipeline instances from this Game Object, based on the given name, and destroys them.
363363
*
364364
* If you wish to remove all Post Pipelines use the `resetPostPipeline` method instead.
365365
*
@@ -375,7 +375,7 @@ var Pipeline = {
375375
{
376376
var pipelines = this.postPipelines;
377377

378-
for (var i = 0; i < pipelines.length; i++)
378+
for (var i = pipelines.length - 1; i >= 0; i--)
379379
{
380380
var instance = pipelines[i];
381381

@@ -386,11 +386,11 @@ var Pipeline = {
386386
instance.destroy();
387387

388388
SpliceOne(pipelines, i);
389-
390-
return this;
391389
}
392390
}
393391

392+
this.hasPostPipeline = (this.postPipelines.length > 0);
393+
394394
return this;
395395
},
396396

0 commit comments

Comments
 (0)