mirror of
https://github.com/photonstorm/phaser
synced 2024-11-23 21:24:09 +00:00
Fixed sounds array truncate logic in update method
This commit is contained in:
parent
7e223685b3
commit
78c74739fc
1 changed files with 3 additions and 3 deletions
|
@ -201,9 +201,9 @@ var BaseSoundManager = new Class({
|
||||||
this.sounds.sort(function (s1, s2) {
|
this.sounds.sort(function (s1, s2) {
|
||||||
return (s1.pendingRemove === s2.pendingRemove) ? 0 : s1 ? 1 : -1;
|
return (s1.pendingRemove === s2.pendingRemove) ? 0 : s1 ? 1 : -1;
|
||||||
});
|
});
|
||||||
for (var i = this.sounds.length - 1; i >= 0; i--) {
|
for (var i = 0; i < this.sounds.length; i++) {
|
||||||
if (!this.sounds[i].pendingRemove) {
|
if (this.sounds[i].pendingRemove) {
|
||||||
this.sounds.splice(this.sounds.length - 1 - i);
|
this.sounds.length = i;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue