]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Merge branch 'master' into Mario/duel
authorMario <mario@smbclan.net>
Sun, 30 Sep 2018 12:26:19 +0000 (22:26 +1000)
committerMario <mario@smbclan.net>
Sun, 30 Sep 2018 12:26:19 +0000 (22:26 +1000)
1  2 
gamemodes-server.cfg
qcsrc/server/bot/default/bot.qc
qcsrc/server/client.qc

diff --combined gamemodes-server.cfg
index 862de2bd54f295dfe1bd67233566e715783243da,5a9ec457b5ca6613dc617929d0e0c69f290ff825..7cc47c3639858e77f0aea47961a61ecd86bd5378
@@@ -28,7 -28,6 +28,7 @@@ alias sv_hook_gamestart_ct
  alias sv_hook_gamestart_ka
  alias sv_hook_gamestart_ft
  alias sv_hook_gamestart_inv
 +alias sv_hook_gamestart_duel
  alias sv_hook_gamerestart
  alias sv_hook_gameend
  
@@@ -55,17 -54,16 +55,17 @@@ alias sv_vote_gametype_hook_n
  alias sv_vote_gametype_hook_ons
  alias sv_vote_gametype_hook_rc
  alias sv_vote_gametype_hook_tdm
 +alias sv_vote_gametype_hook_duel
  
 -// Example preset to allow duel to be used for the gametype voting screen
 +// Example preset to allow 1v1ctf to be used for the gametype voting screen
  // sv_vote_gametype_*_type Must be set to the name of the gametype the option is based on
  // sv_vote_gametype_*_name Contains a human-readable name of the gametype
  // sv_vote_gametype_*_description Contains a longer description
 -//set sv_vote_gametype_duel_type dm
 -//set sv_vote_gametype_duel_name Duel
 -//set sv_vote_gametype_duel_description "One vs One match"
 +//set sv_vote_gametype_1v1ctf_type ctf
 +//set sv_vote_gametype_1v1ctf_name "Capture the Flag Duel"
 +//set sv_vote_gametype_1v1ctf_description "One vs One match in CTF"
  //alias sv_vote_gametype_hook_all "set g_maxplayers 0"
 -//alias sv_vote_gametype_hook_duel "set g_maxplayers 2"
 +//alias sv_vote_gametype_hook_1v1ctf "set g_maxplayers 2"
  
  
  // ===========
@@@ -198,13 -196,6 +198,13 @@@ set g_inv_respawn_delay_large_count 
  set g_inv_respawn_delay_max 0
  set g_inv_respawn_waves 0
  set g_inv_weapon_stay 0
 +set g_duel_respawn_delay_small 0
 +set g_duel_respawn_delay_small_count 0
 +set g_duel_respawn_delay_large 0
 +set g_duel_respawn_delay_large_count 0
 +set g_duel_respawn_delay_max 0
 +set g_duel_respawn_waves 0
 +set g_duel_weapon_stay 0
  
  
  // =========
@@@ -324,6 -315,8 +324,8 @@@ set g_cts_send_rankings_cnt 15 "send th
  //  deathmatch (ffa or team)
  // ==========================
  set g_dm 1 "Deathmatch: killing any other player is one frag, player with most frags wins"
+ set g_tdm 0 "Team Deathmatch: the team who kills their opponents most often wins"
+ set g_tdm_on_dm_maps 0 "when this is set, all DM maps automatically support TDM"
  set g_tdm_teams 2 "how many teams are in team deathmatch (set by mapinfo)"
  set g_tdm_team_spawns 0 "when 1, players spawn from the team spawnpoints of the map, if any"
  seta g_tdm_teams_override 0   "how many teams are in team deathmatch"
@@@ -532,8 -525,3 +534,8 @@@ set g_invasion_spawnpoint_spawn_delay 0
  set g_invasion_teams 0 "number of teams in invasion (note: use mapinfo to set this)"
  set g_invasion_team_spawns 1 "use team spawns in teamplay invasion mode"
  set g_invasion_type 0 "type of invasion mode - 0: round-based, 1: hunting, 2: complete the stage (note: use mapinfo to set this)"
 +
 +// ======
 +//  duel
 +// ======
 +set g_duel 0 "Duel: frag the opponent more in a one versus one arena battle"
index ec84e55167618aea25811a9242963c40a5e22c52,12e93821f1479246c306490ceb4ec0dfdce9a3d4..d9d05773e42b949b1b19522cd1c5246bee1cb7b0
@@@ -593,7 -593,6 +593,7 @@@ float bot_fixcount(
                });
        }
  
 +      //int player_limit = GetPlayerLimit(); // TODO: use this instead of maxclients!
        int bots;
        // But don't remove bots immediately on level change, as the real players
        // usually haven't rejoined yet
                // add bots to reach minplayers if needed
                bots = max(minbots, minplayers - activerealplayers);
                // cap bots to the max players allowed by the server
+               if(autocvar_g_maxplayers)
+                       bots = min(bots, autocvar_g_maxplayers - activerealplayers);
                bots = min(bots, maxclients - realplayers);
  
                if(bots > minbots)
diff --combined qcsrc/server/client.qc
index e705ab3d3a1fa1eaabf69eeefa7c276a4d0aa488,7f8862fdf9cc8015e5cf1267b94b894d23888f04..a8d091e86ed8d4333e8af068005baeda35f9f699
@@@ -1146,7 -1146,7 +1146,7 @@@ void ClientConnect(entity this
        if (IS_REAL_CLIENT(this))
                sv_notice_join(this);
  
-       this.move_qcphysics = true;
+       this.move_qcphysics = false;
  
        // update physics stats (players can spawn before physics runs)
        Physics_UpdateStats(this);
@@@ -1916,14 -1916,6 +1916,14 @@@ void Join(entity this
        this.team_selected = false;
  }
  
 +int GetPlayerLimit()
 +{
 +      int player_limit = autocvar_g_maxplayers;
 +      MUTATOR_CALLHOOK(GetPlayerLimit, player_limit);
 +      player_limit = M_ARGV(0, int);
 +      return player_limit;
 +}
 +
  /**
   * Determines whether the player is allowed to join. This depends on cvar
   * g_maxplayers, if it isn't used this function always return true, otherwise
@@@ -1956,13 -1948,11 +1956,13 @@@ int nJoinAllowed(entity this, entity ig
                        ++currentlyPlaying;
        });
  
 +      int player_limit = GetPlayerLimit();
 +
        float free_slots = 0;
 -      if (!autocvar_g_maxplayers)
 +      if (!player_limit)
                free_slots = maxclients - totalClients;
 -      else if(currentlyPlaying < autocvar_g_maxplayers)
 -              free_slots = min(maxclients - totalClients, autocvar_g_maxplayers - currentlyPlaying);
 +      else if(currentlyPlaying < player_limit)
 +              free_slots = min(maxclients - totalClients, player_limit - currentlyPlaying);
  
        static float join_prevent_msg_time = 0;
        if(this && ignore && !free_slots && time > join_prevent_msg_time)