From a795b87b766dc5777ed6d644fb69cb08166fd3bb Mon Sep 17 00:00:00 2001 From: keqinzhao Date: Fri, 7 Sep 2012 15:48:15 +0800 Subject: [PATCH] Fix a bug: Crash if other layer swallow the touch If other layer swallow the touch, [self.touches count] will equals 0. Then line 289 will cause a crash. --- Extensions/CCLayerPanZoom/CCLayerPanZoom.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Extensions/CCLayerPanZoom/CCLayerPanZoom.m b/Extensions/CCLayerPanZoom/CCLayerPanZoom.m index fdfdc7a..a17338c 100644 --- a/Extensions/CCLayerPanZoom/CCLayerPanZoom.m +++ b/Extensions/CCLayerPanZoom/CCLayerPanZoom.m @@ -283,7 +283,7 @@ - (void) ccTouchesMoved: (NSSet *) touches // Don't click with multitouch self.touchDistance = INFINITY; } - else + else if ([self.touches count] == 1) { // Get the single touch and it's previous & current position. UITouch *touch = [self.touches objectAtIndex: 0];