Fix custom gamemode function called multiple times #14

This commit is contained in:
okvdai
2023-04-30 12:38:37 +02:00
parent 44d4f3351f
commit db1d4d115c
+11 -11
View File
@@ -201,18 +201,18 @@ void function UpdateStatsForMap( string mapName )
print (GetGameModeDisplayColor(modeName)) print (GetGameModeDisplayColor(modeName))
} }
} }
foreach (string key, array<int> value in customGamemodeList) }
if ( key in globalToneAPIGamemodeData) foreach (string key, array<int> value in customGamemodeList)
{ {
int timesCalled = 0 if ( key in globalToneAPIGamemodeData)
float modePlayedTime = 0 {
modePlayedTime = float(globalToneAPIGamemodeData[key]) float modePlayedTime = 0
if ( modePlayedTime > 0 && timesCalled == 0) { modePlayedTime = float(globalToneAPIGamemodeData[key])
AddPieChartEntry( modes, key, modePlayedTime, value) if ( modePlayedTime > 0 ) {
print("CUSTOM GAMEMODE DATA FUNCTION CALLED") AddPieChartEntry( modes, key, modePlayedTime, value)
timesCalled += 1 print("CUSTOM GAMEMODE DATA FUNCTION CALLED")
}
} }
}
} }
const MAX_MODE_ROWS = 8 const MAX_MODE_ROWS = 8