From 6d0ba325f14886dfb51f8cac28f48fb44ce5649a Mon Sep 17 00:00:00 2001 From: Timo Smit Date: Thu, 3 Jan 2019 12:14:13 +0100 Subject: [PATCH] Fixed greetings returning errors when database is not connected --- luamods/wolfadmin/players/greetings.lua | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/luamods/wolfadmin/players/greetings.lua b/luamods/wolfadmin/players/greetings.lua index 005bb43..c9f2531 100644 --- a/luamods/wolfadmin/players/greetings.lua +++ b/luamods/wolfadmin/players/greetings.lua @@ -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) - local lvl = auth.getPlayerLevel(clientId) - - if not auth.isPlayerAllowed(clientId, auth.PERM_INCOGNITO) then + if db.isConnected() and not auth.isPlayerAllowed(clientId, auth.PERM_INCOGNITO) then + local lvl = auth.getPlayerLevel(clientId) + if userGreetings[players.getGUID(clientId)] ~= nil then return userGreetings[players.getGUID(clientId)] elseif levelGreetings[lvl] ~= nil then