X-Git-Url: https://git.yukkurigames.com/?p=enjoyable.git;a=blobdiff_plain;f=Classes%2FNJInputController.m;h=2200cb0dbbbb1ad5fa9ebfc307bdfbce3a8650c0;hp=ed0d72d8208c14ef0f771bff4bb7ec66bc7be188;hb=baa03e73a5af66b725f58fa5efd04bf54b7b2eed;hpb=e68e5783e020bbd7142ee633000a4916bcc25203 diff --git a/Classes/NJInputController.m b/Classes/NJInputController.m index ed0d72d..2200cb0 100644 --- a/Classes/NJInputController.m +++ b/Classes/NJInputController.m @@ -380,7 +380,8 @@ static CVReturn _updateDL(CVDisplayLinkRef displayLink, - (void)removeMappingAtIndex:(NSInteger)idx { NSInteger currentIdx = [self indexOfMapping:_currentMapping]; [_mappings removeObjectAtIndex:idx]; - [self activateMapping:self.mappings[MIN(currentIdx, _mappings.count - 1)]]; + NSInteger activeIdx = MIN(currentIdx, (NSInteger)_mappings.count - 1); + [self activateMapping:self.mappings[activeIdx]]; [self mappingsChanged]; }