Fixed greetings returning errors when database is not connected

This commit is contained in:
Timo Smit 2019-01-03 12:14:13 +01:00
parent 2a71ab2bb1
commit 6d0ba325f1
1 changed files with 5 additions and 3 deletions

View File

@ -17,6 +17,8 @@
local auth = require (wolfa_getLuaPath()..".auth.auth")
local db = require (wolfa_getLuaPath()..".db.db")
local players = require (wolfa_getLuaPath()..".players.players")
local constants = require (wolfa_getLuaPath()..".util.constants")
@ -33,9 +35,9 @@ local userGreetings = {}
local levelGreetings = {}
function greetings.get(clientId)
if db.isConnected() and not auth.isPlayerAllowed(clientId, auth.PERM_INCOGNITO) then
local lvl = auth.getPlayerLevel(clientId)
if not auth.isPlayerAllowed(clientId, auth.PERM_INCOGNITO) then
if userGreetings[players.getGUID(clientId)] ~= nil then
return userGreetings[players.getGUID(clientId)]
elseif levelGreetings[lvl] ~= nil then