Skip to content

Commit

Permalink
Fixed mutes being checked regardless of module mode (refs #61)
Browse files Browse the repository at this point in the history
  • Loading branch information
Timo Smit committed Feb 16, 2018
1 parent 30750d7 commit 6a3459d
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions luamods/wolfadmin/admin/admin.lua
Expand Up @@ -64,15 +64,17 @@ end
events.handle("onClientConnectAttempt", admin.onClientConnectAttempt)

function admin.onClientConnect(clientId, firstTime, isBot)
local guid = et.Info_ValueForKey(et.trap_GetUserinfo(clientId), "cl_guid")
local player = db.getPlayer(guid)
if settings.get("g_standalone") ~= 0 and settings.get("db_type") ~= "none" then
local guid = et.Info_ValueForKey(et.trap_GetUserinfo(clientId), "cl_guid")
local player = db.getPlayer(guid)

if player then
local playerId = player["id"]
local mute = db.getMuteByPlayer(playerId)
if player then
local playerId = player["id"]
local mute = db.getMuteByPlayer(playerId)

if mute then
players.setMuted(clientId, true, mute["type"], mute["issued"], mute["expires"])
if mute then
players.setMuted(clientId, true, mute["type"], mute["issued"], mute["expires"])
end
end
end
end
Expand Down

0 comments on commit 6a3459d

Please sign in to comment.