Reset variables when round ends

master
David Vogel 6 years ago
parent 1e4ba6002d
commit e90128431b

@ -51,7 +51,9 @@ hook.Add("WaveStateChanged", "pointsave_zombieintervalactivator", function()
end
end)
-- TODO: Reset counters on new round.
local function resetVariables()
zombieIntervalCounter, totalIntervalCounter = 0, 0
end
local function postStatistics(mapParams, timesPlayed, freqMult, zombiePercentCalcMap)
PrintMessage(HUD_PRINTTALK,"<c=0,255,255>This map has been played "..timesPlayed.." times with humans winning "..(mapParams.TimesWon).." times.("..(math.Round((mapParams.TimesWon/timesPlayed)*100)).."%)</c>")
@ -76,6 +78,7 @@ hook.Add("PostEndRound", "pointsave_givedapoints", function(winner)
PrintMessage(HUD_PRINTTALK, "No end of game points because zombies were not even playing half the time!")
postStatistics(mapParams, timesPlayed, freqMult, zombiePercentCalcMap)
saveMapParams(mapParams)
resetVariables()
return
end
@ -101,6 +104,7 @@ hook.Add("PostEndRound", "pointsave_givedapoints", function(winner)
PrintMessage(HUD_PRINTTALK,"Sorry, this map needs to be played at least "..(settings.MinimumRounds - timesPlayed).." more times, before you can get points for winning.")
postStatistics(mapParams, timesPlayed, freqMult, zombiePercentCalcMap)
saveMapParams(mapParams)
resetVariables()
return
end
@ -145,6 +149,7 @@ hook.Add("PostEndRound", "pointsave_givedapoints", function(winner)
-- Output general stats about this map
postStatistics(mapParams, timesPlayed, freqMult, zombiePercentCalcMap)
resetVariables()
end)
end)
Loading…
Cancel
Save