Merge branch 'master' into Mario/killsound
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / g_world.qc
index 2acc67a..71c731a 100644 (file)
@@ -227,9 +227,11 @@ void cvar_changes_init()
                BADCVAR("sys_specialcharactertranslation");
                BADCVAR("timeformat");
                BADCVAR("timestamps");
+               BADCVAR("g_require_stats");
                BADPREFIX("developer_");
                BADPREFIX("g_ban_");
                BADPREFIX("g_banned_list");
+               BADPREFIX("g_require_stats_");
                BADPREFIX("g_chat_flood_");
                BADPREFIX("g_ghost_items");
                BADPREFIX("g_playerstats_");
@@ -251,17 +253,22 @@ void cvar_changes_init()
 
                // mapinfo
                BADCVAR("fraglimit");
+               BADCVAR("g_arena");
                BADCVAR("g_assault");
                BADCVAR("g_ca");
                BADCVAR("g_ca_teams");
+               BADCVAR("g_conquest");
                BADCVAR("g_ctf");
                BADCVAR("g_cts");
+               BADCVAR("g_dotc");
                BADCVAR("g_dm");
                BADCVAR("g_domination");
                BADCVAR("g_domination_default_teams");
                BADCVAR("g_freezetag");
                BADCVAR("g_freezetag_teams");
                BADCVAR("g_invasion_teams");
+               BADCVAR("g_jailbreak");
+               BADCVAR("g_jailbreak_teams");
                BADCVAR("g_keepaway");
                BADCVAR("g_keyhunt");
                BADCVAR("g_keyhunt_teams");
@@ -272,12 +279,15 @@ void cvar_changes_init()
                BADCVAR("g_race_laps_limit");
                BADCVAR("g_race_qualifying_timelimit");
                BADCVAR("g_race_qualifying_timelimit_override");
+               BADCVAR("g_snafu");
                BADCVAR("g_tdm");
                BADCVAR("g_tdm_teams");
+               BADCVAR("g_vip");
                BADCVAR("leadlimit");
                BADCVAR("nextmap");
                BADCVAR("teamplay");
                BADCVAR("timelimit");
+               BADCVAR("g_mapinfo_ignore_warnings");
 
                // long
                BADCVAR("hostname");
@@ -307,6 +317,8 @@ void cvar_changes_init()
                BADCVAR("gameversion");
                BADCVAR("g_allow_oldvortexbeam");
                BADCVAR("g_balance_kill_delay");
+               BADCVAR("g_buffs_pickup_anyway");
+               BADCVAR("g_buffs_randomize");
                BADCVAR("g_campcheck_distance");
                BADCVAR("g_ca_point_leadlimit");
                BADCVAR("g_ca_point_limit");
@@ -319,11 +331,14 @@ void cvar_changes_init()
                BADCVAR("g_freezetag_point_limit");
                BADCVAR("g_hats");
                BADCVAR("g_invasion_point_limit");
+               BADCVAR("g_jump_grunt");
                BADCVAR("g_keyhunt_point_leadlimit");
+               BADCVAR("g_maplist_selectrandom");
                BADCVAR("g_nexball_goalleadlimit");
                BADCVAR("g_new_toys_use_pickupsound");
                BADCVAR("g_physics_predictall");
                BADCVAR("g_piggyback");
+               BADCVAR("g_playerclip_collisions");
                BADCVAR("g_tdm_point_leadlimit");
                BADCVAR("g_tdm_point_limit");
                BADCVAR("leadlimit_and_fraglimit");
@@ -336,6 +351,7 @@ void cvar_changes_init()
                BADCVAR("sv_precacheplayermodels");
                BADCVAR("sv_stepheight");
                BADCVAR("sv_timeout");
+               BADCVAR("sv_weapons_modeloverride");
                BADPREFIX("crypto_");
                BADPREFIX("gameversion_");
                BADPREFIX("g_chat_");
@@ -400,6 +416,7 @@ void cvar_changes_init()
                BADCVAR("g_nexball_goallimit");
                BADCVAR("g_norecoil");
                BADCVAR("g_physics_clientselect");
+               BADCVAR("g_pinata");
                BADCVAR("g_powerups");
                BADCVAR("g_spawnshieldtime");
                BADCVAR("g_start_delay");
@@ -1137,7 +1154,7 @@ float(float exponent) MaplistMethod_Shuffle = // more clever shuffling
                string newlist;
 
                // now reinsert this at another position
-               insertpos = pow(random(), 1 / exponent);       // ]0, 1]
+               insertpos = (random() ** (1 / exponent));       // ]0, 1]
                insertpos = insertpos * (Map_Count - 1);       // ]0, Map_Count - 1]
                insertpos = ceil(insertpos) + 1;               // {2, 3, 4, ..., Map_Count}
                LOG_TRACE("SHUFFLE: insert pos = ", ftos(insertpos));
@@ -1447,11 +1464,11 @@ void DumpStats(float final)
                        s = strcat(s, "spectator:");
 
                if(to_console)
-                       LOG_INFO(s, it.netname, "\n");
+                       LOG_INFO(s, playername(it, false), "\n");
                if(to_eventlog)
-                       GameLogEcho(strcat(s, ftos(it.playerid), ":", it.netname));
+                       GameLogEcho(strcat(s, ftos(it.playerid), ":", playername(it, false)));
                if(to_file)
-                       fputs(file, strcat(s, it.netname, "\n"));
+                       fputs(file, strcat(s, playername(it, false), "\n"));
        ));
 
        if(teamplay)
@@ -1528,9 +1545,8 @@ only called if a time or frag limit has expired
 */
 void NextLevel()
 {
-       gameover = true;
-
-       intermission_running = 1;
+       game_stopped = true;
+       intermission_running = 1; // game over
 
        // enforce a wait time before allowing changelevel
        if(player_count > 0)
@@ -1565,7 +1581,7 @@ void NextLevel()
        FOREACH_CLIENT(IS_PLAYER(it), LAMBDA(
                FixIntermissionClient(it);
                if(it.winning)
-                       bprint(it.netname, " ^7wins.\n");
+                       bprint(playername(it, false), " ^7wins.\n");
        ));
 
        target_music_kill();
@@ -1587,7 +1603,7 @@ Exit deathmatch games upon conditions
 */
 void CheckRules_Player(entity this)
 {
-       if (gameover)   // someone else quit the game already
+       if (game_stopped) // someone else quit the game already
                return;
 
        if(!IS_DEAD(this))
@@ -2030,7 +2046,9 @@ void Physics_Frame()
                if(IS_CLIENT(it) || it.classname == "" || it.move_movetype == MOVETYPE_PUSH || it.move_movetype == MOVETYPE_FAKEPUSH || it.move_movetype == MOVETYPE_PHYSICS)
                        continue;
 
-               set_movetype(it, it.move_movetype);
+               //set_movetype(it, it.move_movetype);
+               // inline the set_movetype function, since this is called a lot
+               it.movetype = (it.move_qcphysics) ? MOVETYPE_NONE : it.move_movetype;
 
                if(it.move_movetype == MOVETYPE_NONE)
                        continue;
@@ -2091,10 +2109,6 @@ void EndFrame()
        {
                antilag_record(it, it, altime);
        });
-       FOREACH_CLIENT(PS(it), {
-               PlayerState s = PS(it);
-               s.ps_push(s, it);
-       });
        systems_update();
        IL_ENDFRAME();
 }
@@ -2167,7 +2181,7 @@ void RestoreGame()
 
 void Shutdown()
 {
-       gameover = 2;
+       game_stopped = 2;
 
        if(world_initialized > 0)
        {