]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/g_world.qc
Consistency-- activator functions should have no other suffix.
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / g_world.qc
index b93d4f53d7aca7cdf52e922673067dd076cd3e90..c55d8afd14ddecb3e3a6fcaf530eca99feceb01d 100644 (file)
@@ -253,7 +253,6 @@ void cvar_changes_init()
 
                // mapinfo
                BADCVAR("fraglimit");
-               BADCVAR("g_arena");
                BADCVAR("g_assault");
                BADCVAR("g_ca");
                BADCVAR("g_ca_teams");
@@ -304,7 +303,6 @@ void cvar_changes_init()
 
                // does nothing visible
                BADCVAR("captureleadlimit_override");
-               BADCVAR("g_arena_point_leadlimit");
                BADCVAR("g_balance_kill_delay");
                BADCVAR("g_ca_point_leadlimit");
                BADCVAR("g_ctf_captimerecord_always");
@@ -646,7 +644,7 @@ void spawnfunc_worldspawn (void)
 
        Map_MarkAsRecent(mapname);
 
-       PlayerStats_Init(); // we need this to be initiated before InitGameplayMode
+       PlayerStats_GameReport_Init(); // we need this to be initiated before InitGameplayMode
 
        precache_model ("null"); // we need this one before InitGameplayMode
        InitGameplayMode();
@@ -1401,7 +1399,7 @@ void DumpStats(float final)
                {
                        s = strcat(":player:see-labels:", GetPlayerScoreString(other, 0), ":");
                        s = strcat(s, ftos(rint(time - other.jointime)), ":");
-                       if(IS_PLAYER(other) || g_arena || other.caplayer == 1 || g_lms)
+                       if(IS_PLAYER(other) || other.caplayer == 1 || g_lms)
                                s = strcat(s, ftos(other.team), ":");
                        else
                                s = strcat(s, "spectator:");
@@ -1508,11 +1506,7 @@ void NextLevel()
        DumpStats(TRUE);
 
        // send statistics
-       entity e;
-       PlayerStats_EndMatch(1);
-       FOR_EACH_CLIENT(e)
-               PlayerStats_AddGlobalInfo(e);
-       PlayerStats_Shutdown();
+       PlayerStats_GameReport(TRUE);
        WeaponStats_Shutdown();
 
        Kill_Notification(NOTIF_ALL, world, MSG_CENTER, 0); // kill all centerprints now
@@ -1855,7 +1849,7 @@ float WinningCondition_Scores(float limit, float leadlimit)
        if(WinningConditionHelper_zeroisworst)
                leadlimit = 0; // not supported in this mode
 
-       if(g_dm || g_tdm || g_arena || g_ca || (g_race && !g_race_qualifying) || g_nexball)
+       if(g_dm || g_tdm || g_ca || (g_race && !g_race_qualifying) || g_nexball)
        // these modes always score in increments of 1, thus this makes sense
        {
                if(leaderfrags != WinningConditionHelper_topscore)
@@ -2644,16 +2638,26 @@ void MapVote_Tick()
 }
 void MapVote_Start()
 {
-       if(mapvote_run)
-               return;
+       // if mapvote is already running, don't do this initialization again
+       if(mapvote_run) { return; }
 
-       // wait for stats to be sent first
-       if(!playerstats_waitforme)
-               return;
+       // don't start mapvote until after playerstats gamereport is sent
+       if(PlayerStats_GameReport_DelayMapVote) { return; }
 
+       // set up map information for mapvote
        MapInfo_Enumerate();
-       if(MapInfo_FilterGametype(MapInfo_CurrentGametype(), MapInfo_CurrentFeatures(), MapInfo_RequiredFlags(), MapInfo_ForbiddenFlags(), 1))
-               mapvote_run = TRUE;
+       if
+       (
+               MapInfo_FilterGametype
+               (
+                       MapInfo_CurrentGametype(),
+                       MapInfo_CurrentFeatures(),
+                       MapInfo_RequiredFlags(),
+                       MapInfo_ForbiddenFlags(),
+                       1
+               )
+       )
+               { mapvote_run = TRUE; }
 }
 void MapVote_Think()
 {
@@ -2826,8 +2830,6 @@ void RestoreGame()
 
 void Shutdown()
 {
-       entity e;
-
        gameover = 2;
 
        if(world_initialized > 0)
@@ -2836,10 +2838,8 @@ void Shutdown()
                print("Saving persistent data...\n");
                Ban_SaveBans();
 
-               PlayerStats_EndMatch(0);
-               FOR_EACH_CLIENT(e)
-                       PlayerStats_AddGlobalInfo(e);
-               PlayerStats_Shutdown();
+               // playerstats with unfinished match
+               PlayerStats_GameReport(FALSE);
 
                if(!cheatcount_total)
                {