Fixed end of sprees not displayed in all cases

This commit is contained in:
Timo Smit 2017-03-13 16:40:05 +01:00
parent 1a3b91fb06
commit abb6c45e55

View file

@ -248,7 +248,7 @@ function sprees.onPlayerSpreeEnd(clientId, causeId, type)
local settingSpreeMessages = settings.get("g_spreeMessages")
if type == sprees.RECORD_DEATH then
if settingSpreeMessages ~= 0 and bits.hasbit(settingSpreeMessages, 2^type) and playerSprees[clientId][sprees.RECORD_DEATH] > spreeMessagesByType[sprees.RECORD_DEATH][1]["amount"] then
if settingSpreeMessages ~= 0 and bits.hasbit(settingSpreeMessages, 2^type) and 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),
players.getName(clientId),
@ -262,7 +262,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 settingSpreeMessages ~= 0 and bits.hasbit(settingSpreeMessages, 2^i) and 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