From c8d2c23048b33d467db5ad1ad95f9886caf0815f Mon Sep 17 00:00:00 2001 From: David Vogel Date: Mon, 16 Jul 2018 18:50:05 +0200 Subject: [PATCH] Fixes --- lua/autorun/server/pointsaving_mapstats.lua | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lua/autorun/server/pointsaving_mapstats.lua b/lua/autorun/server/pointsaving_mapstats.lua index e4fbc14..fa0d7c0 100644 --- a/lua/autorun/server/pointsaving_mapstats.lua +++ b/lua/autorun/server/pointsaving_mapstats.lua @@ -57,9 +57,9 @@ end local function postStatistics(mapParams, timesPlayed, freqMult, zombiePercentCalcMap) PrintMessage(HUD_PRINTTALK,"This map has been played "..timesPlayed.." times with humans winning "..(mapParams.TimesWon).." times.("..(math.Round((mapParams.TimesWon/timesPlayed)*100)).."%)") - PrintMessage(HUD_PRINTTALK,"Zombies were only playing for "..math.Round(zombiePercentCalcMap * 100).."% of the time.") - PrintMessage(HUD_PRINTTALK,"frequency multiplier for this map is: "..freqMult..". play maps infrequently for a higher value!") - PrintMessage(HUD_PRINTTALK,"Special boost for this map is:"..(mapParams.Boost)..". tell an admin if you think it should be changed!") + PrintMessage(HUD_PRINTTALK,"Zombies were playing this map for "..math.Round(zombiePercentCalcMap * 100).."% of the time.") + PrintMessage(HUD_PRINTTALK,"frequency multiplier for this map is "..freqMult..". play maps infrequently for a higher value!") + PrintMessage(HUD_PRINTTALK,"Special boost for this map is "..(mapParams.Boost)..". tell an admin if you think it should be changed!") PrintMessage(HUD_PRINTTALK,"Map jackpot is now "..(mapParams.Jackpot)..".") end @@ -80,9 +80,9 @@ hook.Add("PostEndRound", "pointsave_givedapoints", function(winner) timer.Simple(0, function() print("point bonus hook") - local zombiePercentCalcMap = (zombieIntervalCounter / totalIntervalCounter) or .01 + local zombiePercentCalcMap = (zombieIntervalCounter / totalIntervalCounter) local timesPlayed = mapParams.TimesWon + mapParams.TimesLost - local freqMult = 1 / math.pow(timesPlayed / 10, 0.2) + 1 + local freqMult = 1 / math.pow(math.Max(timesPlayed, 10) / 10, 0.2) + 1 -- Check if zombies did even play most of the map if zombiePercentCalcMap <= .5 then @@ -112,7 +112,7 @@ hook.Add("PostEndRound", "pointsave_givedapoints", function(winner) -- Again, as the counter changed timesPlayed = mapParams.TimesWon + mapParams.TimesLost - freqMult = 1 / math.pow(timesPlayed / 10, 0.2) + 1 + local freqMult = 1 / math.pow(math.Max(timesPlayed, 10) / 10, 0.2) + 1 -- Check if map was played enough times if timesPlayed < settings.MinimumRounds then