Skip to content

Commit ae5a6a6

Browse files
author
SeanLin
committed
Merge pull request cocos2d#971 from dingpinglv/Iss2144_FixBugForParticleSystem
fixed cocos2d#2144 modify condition for WebGL Mode.
2 parents 855dfc8 + 1ef9c93 commit ae5a6a6

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

cocos2d/particle_nodes/CCParticleSystem.js

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1476,15 +1476,19 @@ cc.ParticleSystem = cc.Node.extend(/** @lends cc.ParticleSystem# */{
14761476
* Add a particle to the emitter
14771477
* @return {Boolean}
14781478
*/
1479-
addParticle:function () {
1479+
addParticle: function () {
14801480
if (this.isFull())
14811481
return false;
14821482
var particle, particles = this._particles;
1483-
if(cc.renderContextType === cc.CANVAS && this._particleCount < particles.length){
1484-
particle =particles[this._particleCount];
1485-
}else{
1486-
particle = new cc.Particle();
1487-
particles.push(particle);
1483+
if (cc.renderContextType === cc.CANVAS) {
1484+
if (this._particleCount < particles.length) {
1485+
particle = particles[this._particleCount];
1486+
} else {
1487+
particle = new cc.Particle();
1488+
particles.push(particle);
1489+
}
1490+
} else {
1491+
particle = particles[this._particleCount];
14881492
}
14891493
this.initParticle(particle);
14901494
++this._particleCount;

0 commit comments

Comments
 (0)