File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -268,28 +268,32 @@ - (void) setupCocos2dWithOptions:(NSDictionary*)config
268268// getting a call, pause the game
269269-(void ) applicationWillResignActive : (UIApplication *)application
270270{
271- if ( [navController_ visibleViewController ] == [CCDirector sharedDirector ] )
271+ if ([CCDirector sharedDirector ]. paused == NO ) {
272272 [[CCDirector sharedDirector ] pause ];
273+ }
273274}
274275
275276// call got rejected
276277-(void ) applicationDidBecomeActive : (UIApplication *)application
277278{
278279 [[CCDirector sharedDirector ] setNextDeltaTimeZero: YES ];
279- if ( [navController_ visibleViewController ] == [ CCDirector sharedDirector ] )
280+ if ([ CCDirector sharedDirector ]. paused ) {
280281 [[CCDirector sharedDirector ] resume ];
282+ }
281283}
282284
283285-(void ) applicationDidEnterBackground : (UIApplication*)application
284286{
285- if ( [navController_ visibleViewController ] == [ CCDirector sharedDirector ] )
287+ if ([ CCDirector sharedDirector ]. animating ) {
286288 [[CCDirector sharedDirector ] stopAnimation ];
289+ }
287290}
288291
289292-(void ) applicationWillEnterForeground : (UIApplication*)application
290293{
291- if ( [navController_ visibleViewController ] == [CCDirector sharedDirector ] )
294+ if ([CCDirector sharedDirector ]. animating == NO ) {
292295 [[CCDirector sharedDirector ] startAnimation ];
296+ }
293297}
294298
295299// application will be killed
You can’t perform that action at this time.
0 commit comments