From db1d4d115cbf42f5941af1bc6bcc383b90d4d2d8 Mon Sep 17 00:00:00 2001 From: okvdai <108829133+okvdai@users.noreply.github.com> Date: Sun, 30 Apr 2023 12:38:37 +0200 Subject: [PATCH] Fix custom gamemode function called multiple times #14 --- mod/scripts/vscripts/ui/menu_stats_maps.nut | 22 ++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/mod/scripts/vscripts/ui/menu_stats_maps.nut b/mod/scripts/vscripts/ui/menu_stats_maps.nut index 799b6a0..75d4681 100644 --- a/mod/scripts/vscripts/ui/menu_stats_maps.nut +++ b/mod/scripts/vscripts/ui/menu_stats_maps.nut @@ -201,18 +201,18 @@ void function UpdateStatsForMap( string mapName ) print (GetGameModeDisplayColor(modeName)) } } - foreach (string key, array value in customGamemodeList) - if ( key in globalToneAPIGamemodeData) - { - int timesCalled = 0 - float modePlayedTime = 0 - modePlayedTime = float(globalToneAPIGamemodeData[key]) - if ( modePlayedTime > 0 && timesCalled == 0) { - AddPieChartEntry( modes, key, modePlayedTime, value) - print("CUSTOM GAMEMODE DATA FUNCTION CALLED") - timesCalled += 1 - } + } + foreach (string key, array value in customGamemodeList) + { + if ( key in globalToneAPIGamemodeData) + { + float modePlayedTime = 0 + modePlayedTime = float(globalToneAPIGamemodeData[key]) + if ( modePlayedTime > 0 ) { + AddPieChartEntry( modes, key, modePlayedTime, value) + print("CUSTOM GAMEMODE DATA FUNCTION CALLED") } + } } const MAX_MODE_ROWS = 8