„Modul:ServiceAward” változatai közötti eltérés

Properly handle next rank for users without rank
a (Really do not use next rank value from user stats)
(Properly handle next rank for users without rank)
 
local nextRank = nil
iflocal nextRankIndex = not(userData[USER_STATISTICS_RANK_INDEX] == -1) and ;
table.getn(ranks) > USER_STATISTICS_RANK_INDEX then
if nextRankIndex == -1 then
nextRank = ranks[userData[USER_STATISTICS_RANK_INDEX] + 1]
nextRankIndex = 1
else
nextRankIndex = nextRankIndex + 1
end
if table.getn(ranks) >= USER_STATISTICS_RANK_INDEXnextRankIndex then
nextRank = ranks[nextRankIndex]
templateParams.nextRank = nextRank[RANKS_RANK_NAME_INDEX]
end