From bad7b0933d4a467dfe0f7e211efc02903f989968 Mon Sep 17 00:00:00 2001 From: David Vogel Date: Mon, 16 Jul 2018 18:02:01 +0200 Subject: [PATCH] Fix --- lua/autorun/server/pointsaving_mapstats.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lua/autorun/server/pointsaving_mapstats.lua b/lua/autorun/server/pointsaving_mapstats.lua index 323995c..66c2ae6 100644 --- a/lua/autorun/server/pointsaving_mapstats.lua +++ b/lua/autorun/server/pointsaving_mapstats.lua @@ -74,6 +74,7 @@ hook.Add("PostEndRound", "pointsave_givedapoints", function(winner) print("point bonus hook") local zombiePercentCalcMap = (zombieIntervalCounter / totalIntervalCounter) or .01 local timesPlayed = mapParams.TimesWon + mapParams.TimesLost + local freqMult = 1 / math.pow(timesPlayed / 10, 0.2) + 1 -- Check if zombies did even play most of the map if zombiePercentCalcMap <= .5 then @@ -101,6 +102,10 @@ hook.Add("PostEndRound", "pointsave_givedapoints", function(winner) end end + -- Again, as the counter changed + timesPlayed = mapParams.TimesWon + mapParams.TimesLost + freqMult = 1 / math.pow(timesPlayed / 10, 0.2) + 1 + -- Check if map was played enough times if timesPlayed < settings.MinimumRounds then PrintMessage(HUD_PRINTTALK,"Sorry, this map needs to be played at least "..(settings.MinimumRounds - timesPlayed).." more times, before you can get points for winning.") @@ -111,7 +116,6 @@ hook.Add("PostEndRound", "pointsave_givedapoints", function(winner) end -- Calculate points to give - local freqMult = 1 / math.pow(timesPlayed / 10, 0.2) + 1 local pointsToGive if winner == TEAM_HUMAN then