Skip to content

Commit 82e97cb

Browse files
committed
Merge branch 'patch-4' of git://github.com/smklinger/cocos2d-iphone into v3.0
1 parent 753fe4d commit 82e97cb

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

cocos2d/CCParallaxNode.m

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,15 @@ -(void) addChild: (CCNode*) child z:(NSInteger)z parallaxRatio:(CGPoint)ratio po
9595

9696
-(void) removeChild:(CCNode*)node cleanup:(BOOL)cleanup
9797
{
98-
[_parallaxArray removeObject:node];
98+
for(NSUInteger i = 0; i < _parallaxArray.count; i++){
99+
CGPointObject *point = _parallaxArray[i];
100+
101+
if(point.child == node) {
102+
[_parallaxArray removeObjectAtIndex:i];
103+
break;
104+
}
105+
}
106+
99107
[super removeChild:node cleanup:cleanup];
100108
}
101109

0 commit comments

Comments
 (0)