From 9b83a632621264e28dd1724b90d381727c83d941 Mon Sep 17 00:00:00 2001 From: William Miller Date: Wed, 30 Oct 2024 19:40:11 -0300 Subject: Fix Match Stats Tracking Improperly (#898) Previously would incorrectly count each round in round based modes as individual games duplicating and stacking stats for those modes in the process. This commit changes where the hook happens. Ensures the stats will register only once and only when the match really ends, still disconsidering Epilogue state. --- .../mod/scripts/vscripts/mp/_gamestate_mp.nut | 32 +--------------------- 1 file changed, 1 insertion(+), 31 deletions(-) (limited to 'Northstar.CustomServers/mod/scripts/vscripts/mp/_gamestate_mp.nut') diff --git a/Northstar.CustomServers/mod/scripts/vscripts/mp/_gamestate_mp.nut b/Northstar.CustomServers/mod/scripts/vscripts/mp/_gamestate_mp.nut index 0c66f5a9..17323c38 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/mp/_gamestate_mp.nut +++ b/Northstar.CustomServers/mod/scripts/vscripts/mp/_gamestate_mp.nut @@ -226,37 +226,7 @@ void function SetWinner( int team, string winningReason = "", string losingReaso SetGameState( eGameState.WinnerDetermined ) ScoreEvent_MatchComplete( team ) - array players = GetPlayerArray() - int functionref( entity, entity ) compareFunc = GameMode_GetScoreCompareFunc( GAMETYPE ) - if ( compareFunc != null ) - { - players.sort( compareFunc ) - int playerCount = players.len() - int currentPlace = 1 - for ( int i = 0; i < 3; i++ ) - { - if ( i >= playerCount ) - continue - - if ( i > 0 && compareFunc( players[i - 1], players[i] ) != 0 ) - currentPlace += 1 - - switch( currentPlace ) - { - case 1: - UpdatePlayerStat( players[i], "game_stats", "mvp" ) - UpdatePlayerStat( players[i], "game_stats", "mvp_total" ) - UpdatePlayerStat( players[i], "game_stats", "top3OnTeam" ) - break - case 2: - UpdatePlayerStat( players[i], "game_stats", "top3OnTeam" ) - break - case 3: - UpdatePlayerStat( players[i], "game_stats", "top3OnTeam" ) - break - } - } - } + RegisterMatchStats_OnMatchComplete() } } } -- cgit v1.2.3