Skip to content

Commit 5707baa

Browse files
committed
[CCPhysicsNode setDebugDraw:NO] wasn’t setting the ivar.
1 parent 79d26c3 commit 5707baa

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

cocos2d/CCPhysicsNode.m

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -456,11 +456,12 @@ -(void)fixedUpdate:(CCTime)delta
456456
-(BOOL)debugDraw {return (_debugDraw != nil);}
457457
-(void)setDebugDraw:(BOOL)debugDraw
458458
{
459-
if(debugDraw){
459+
if(debugDraw && !_debugDraw){
460460
_debugDraw = [CCDrawNode node];
461461
[self addChild:_debugDraw z:NSIntegerMax];
462-
} else {
462+
} else if(!debugDraw && _debugDraw){
463463
[_debugDraw removeFromParent];
464+
_debugDraw = nil;
464465
}
465466
}
466467

0 commit comments

Comments
 (0)