From 1455d1927f7d947abd5e781c36172c042e87ef98 Mon Sep 17 00:00:00 2001 From: Joey Yakimowich-Payne Date: Thu, 28 Jun 2018 00:04:36 +0900 Subject: [PATCH] Minor fixes --- src/libnx/account.nim | 3 +++ src/libnx/input.nim | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/libnx/account.nim b/src/libnx/account.nim index 4786455..2ec8aff 100644 --- a/src/libnx/account.nim +++ b/src/libnx/account.nim @@ -82,6 +82,7 @@ proc getImageSize*(profile: AccountProfile): int = result = res.int proc imageSize*(user: User): int = + ensureEnabled() var prof: AccountProfile var size: csize let res = accountProfileGetImageSize(prof.addr, size.addr).newResult @@ -202,6 +203,7 @@ proc getProfile*(user: User): Profile = proc getUserCount*(): int32 = + ensureEnabled() var count: int32 let res = accountGetUserCount(count.addr).newResult if res.failed: @@ -213,6 +215,7 @@ proc getUserCount*(): int32 = proc listAllUsers*(): seq[User] = + ensureEnabled() result = @[] var diff --git a/src/libnx/input.nim b/src/libnx/input.nim index d04969e..1ebbd22 100644 --- a/src/libnx/input.nim +++ b/src/libnx/input.nim @@ -287,7 +287,7 @@ proc getHandheldMode*(): bool = ## and CONTROLLER_PLAYER_2 for example). ## / id must be CONTROLLER_PLAYER_*. proc setJoyConModeSingle*(id: Controller): Result = - if not (id in {Controller.Player1 .. Controller.Player8}): + if id notin {Controller.Player1 .. Controller.Player8}: raiseEx(ControllerSelectError, "Must be controller 1-8") hidSetNpadJoyAssignmentModeSingleByDefault(id.HidControllerId).newResult @@ -299,7 +299,7 @@ proc setJoyConModeSingle*(id: Controller): Result = ## and CONTROLLER_PLAYER_2 for example). ## / id must be CONTROLLER_PLAYER_*. proc setJoyconModeDual*(id: Controller): Result = - if not (id in {Controller.Player1 .. Controller.Player8}): + if id notin {Controller.Player1 .. Controller.Player8}: raiseEx(ControllerSelectError, "Must be controller 1-8") hidSetNpadJoyAssignmentModeDual(id.HidControllerId).newResult