summaryrefslogtreecommitdiff
path: root/src/login/login.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/login/login.cpp')
-rw-r--r--src/login/login.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/login/login.cpp b/src/login/login.cpp
index ccb68fc..a84c96a 100644
--- a/src/login/login.cpp
+++ b/src/login/login.cpp
@@ -231,6 +231,7 @@ AString gm_pass;
static
GmLevel level_new_gm = GmLevel::from(60u);
+// TODO make this just be Map<AccountId, GmLevel>
static
Map<AccountId, GM_Account> gm_account_db;
@@ -287,10 +288,8 @@ void delete_admin(Session *s)
static
GmLevel isGM(AccountId account_id)
{
- GM_Account *p = gm_account_db.search(account_id);
- if (p == nullptr)
- return GmLevel();
- return p->level;
+ Option<P<GM_Account>> p = gm_account_db.search(account_id);
+ return TRY_UNWRAP(p, return GmLevel())->level;
}
//-------------------------------------------------------