# HG changeset patch # User antonc27 # Date 1514583336 -3600 # Node ID 350d8bde5ccd6f506d5a87e9ff3c42c9a6a3bd51 # Parent 941674281760b1af00cdec1336512066b1c65077 - Lazy checks for preventing crash when drawing 'nice hogs' on config screen (frontend) on iPad. Now we have animation glitch sometimes, but this is preferable to crash anyway diff -r 941674281760 -r 350d8bde5ccd project_files/HedgewarsMobile/Classes/GameConfigViewController.m --- a/project_files/HedgewarsMobile/Classes/GameConfigViewController.m Fri Dec 29 19:38:01 2017 +0100 +++ b/project_files/HedgewarsMobile/Classes/GameConfigViewController.m Fri Dec 29 22:35:36 2017 +0100 @@ -274,12 +274,14 @@ UIImage *hatSpriteFrame = [hatSprite cutAt:CGRectMake(x, y, 32, 32)]; UIImage *hogSpriteFrame = [hogSprite cutAt:CGRectMake(x, y, 32, 32)]; UIImage *hogWithHat = [hogSpriteFrame mergeWith:hatSpriteFrame atPoint:CGPointMake(0, 5)]; - [animation addObject:hogWithHat]; + if (hogWithHat) { + [animation addObject:hogWithHat]; + } } [hatSprite release]; [hatFile release]; - UIImageView *hog = [[UIImageView alloc] initWithImage:[animation objectAtIndex:0]]; + UIImageView *hog = [[UIImageView alloc] initWithImage:[animation firstObject]]; hog.animationImages = animation; hog.animationDuration = 3; [animation release];