From 380aba96cbb2c07f95b68cefc339e7dd8e5419f7 Mon Sep 17 00:00:00 2001 From: Timo Smit Date: Sun, 12 Mar 2017 21:32:22 +0100 Subject: [PATCH] Removed print of end of spree messages if they're disabled --- luamods/wolfadmin/game/sprees.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/luamods/wolfadmin/game/sprees.lua b/luamods/wolfadmin/game/sprees.lua index 0d6e47a..01152cf 100644 --- a/luamods/wolfadmin/game/sprees.lua +++ b/luamods/wolfadmin/game/sprees.lua @@ -243,7 +243,9 @@ function sprees.onPlayerSpree(clientId, type, sourceId) end function sprees.onPlayerSpreeEnd(clientId, causeId, type) - if type == sprees.RECORD_DEATH then + local settingSpreeMessages = settings.get("g_spreeMessages") + + if type == sprees.RECORD_DEATH and settingSpreeMessages ~= 0 and bits.hasbit(settingSpreeMessages, 2^type) then if playerSprees[clientId][sprees.RECORD_DEATH] > spreeMessagesByType[sprees.RECORD_DEATH][1]["amount"] then local msg = string.format("^7%s^d was the first victim of ^7%s ^dafter ^3%d ^d%ss!", players.getName(causeId), @@ -258,7 +260,7 @@ function sprees.onPlayerSpreeEnd(clientId, causeId, type) elseif type == nil then for i = 0, sprees.RECORD_NUM - 1 do if i ~= sprees.RECORD_DEATH then - if playerSprees[clientId][i] > spreeMessagesByType[i][1]["amount"] then + if settingSpreeMessages ~= 0 and bits.hasbit(settingSpreeMessages, 2^i) and playerSprees[clientId][i] > spreeMessagesByType[i][1]["amount"] then local msg = "" if clientId == causeId then