summary refs log tree commit diff stats
path: root/Classes/GameModeInfo.m
diff options
context:
space:
mode:
authorStarla Insigna <starla4444@gmail.com>2013-01-04 12:40:49 -0500
committerStarla Insigna <starla4444@gmail.com>2013-01-04 12:40:49 -0500
commit964cad39cd7373a320516914cbcb0c4207ed4e64 (patch)
tree9aa9b7c0c9cd7ff61dc2f6c1930a36a5987b951a /Classes/GameModeInfo.m
parentade84cf3d464f6f1dc2becf16602db759d689398 (diff)
downloadcartcollect-964cad39cd7373a320516914cbcb0c4207ed4e64.tar.gz
cartcollect-964cad39cd7373a320516914cbcb0c4207ed4e64.tar.bz2
cartcollect-964cad39cd7373a320516914cbcb0c4207ed4e64.zip
Added third star to Collect and added failsafe for GameModeInfo's init in case numOfStars is over 3
Diffstat (limited to 'Classes/GameModeInfo.m')
-rw-r--r--Classes/GameModeInfo.m5
1 files changed, 5 insertions, 0 deletions
diff --git a/Classes/GameModeInfo.m b/Classes/GameModeInfo.m index 08b95e5..91543fa 100644 --- a/Classes/GameModeInfo.m +++ b/Classes/GameModeInfo.m
@@ -34,6 +34,11 @@
34 unlocked = m_unlocked; 34 unlocked = m_unlocked;
35 } 35 }
36 36
37 if (numOfStars > 3)
38 {
39 @throw [NSException exceptionWithName:NSInvalidArgumentException reason:@"There does not exist support for more than three stars in a game mode." userInfo:nil];
40 }
41
37 stars = (BOOL*) calloc(numOfStars, sizeof(BOOL)); 42 stars = (BOOL*) calloc(numOfStars, sizeof(BOOL));
38 for (int i=0; i<numOfStars; i++) 43 for (int i=0; i<numOfStars; i++)
39 { 44 {