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
268
268
// getting a call, pause the game
269
269
-(void ) applicationWillResignActive : (UIApplication *)application
270
270
{
271
- if ( [navController_ visibleViewController ] == [CCDirector sharedDirector ] )
271
+ if ([CCDirector sharedDirector ]. paused == NO ) {
272
272
[[CCDirector sharedDirector ] pause ];
273
+ }
273
274
}
274
275
275
276
// call got rejected
276
277
-(void ) applicationDidBecomeActive : (UIApplication *)application
277
278
{
278
279
[[CCDirector sharedDirector ] setNextDeltaTimeZero: YES ];
279
- if ( [navController_ visibleViewController ] == [ CCDirector sharedDirector ] )
280
+ if ([ CCDirector sharedDirector ]. paused ) {
280
281
[[CCDirector sharedDirector ] resume ];
282
+ }
281
283
}
282
284
283
285
-(void ) applicationDidEnterBackground : (UIApplication*)application
284
286
{
285
- if ( [navController_ visibleViewController ] == [ CCDirector sharedDirector ] )
287
+ if ([ CCDirector sharedDirector ]. animating ) {
286
288
[[CCDirector sharedDirector ] stopAnimation ];
289
+ }
287
290
}
288
291
289
292
-(void ) applicationWillEnterForeground : (UIApplication*)application
290
293
{
291
- if ( [navController_ visibleViewController ] == [CCDirector sharedDirector ] )
294
+ if ([CCDirector sharedDirector ]. animating == NO ) {
292
295
[[CCDirector sharedDirector ] startAnimation ];
296
+ }
293
297
}
294
298
295
299
// application will be killed
You can’t perform that action at this time.
0 commit comments