X-Git-Url: https://git.yukkurigames.com/?a=blobdiff_plain;f=Classes%2FNJInputController.m;h=2200cb0dbbbb1ad5fa9ebfc307bdfbce3a8650c0;hb=0a8d6333a3ac4684b70ab7f3581a93bf96638d6f;hp=ed0d72d8208c14ef0f771bff4bb7ec66bc7be188;hpb=dc526070b502b03b2c98c679bbbde371b21eeb9a;p=enjoyable.git 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]; }