Skip to content

Commit

Permalink
Fix issue cocos2d#108 using fishcake's commit 256639c
Browse files Browse the repository at this point in the history
  • Loading branch information
Jan Parchmann committed Jul 17, 2012
1 parent 4899616 commit e5b421f
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Extensions/CCLayerPanZoom/CCLayerPanZoom.m
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,14 @@ - (void) ccTouchesBegan: (NSSet *) touches
- (void) ccTouchesMoved: (NSSet *) touches
withEvent: (UIEvent *) event
{

// Fixes issue #108:
// ccTouchesMoved should never be called if ccTouchesBegan is not called first.
// However, when the scene is transitioning in, ccTouchesBegan is not called,
// causing self.touches to be empty, thus crashing the app due to an attempt
// to access an empty array.
if ([self.touches count] == 0) return;

BOOL multitouch = [self.touches count] > 1;
if (multitouch)
{
Expand Down

0 comments on commit e5b421f

Please sign in to comment.