]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Merge branch 'master' into Lyberta/TeamplayOverhaul
authorLyberta <lyberta@lyberta.net>
Fri, 15 Jun 2018 04:51:33 +0000 (07:51 +0300)
committerLyberta <lyberta@lyberta.net>
Fri, 15 Jun 2018 04:51:33 +0000 (07:51 +0300)
1  2 
qcsrc/common/gamemodes/gamemode/ctf/ctf.qc
qcsrc/server/client.qc
qcsrc/server/command/cmd.qc
qcsrc/server/command/sv_cmd.qc
qcsrc/server/g_world.qc
qcsrc/server/g_world.qh
qcsrc/server/mutators/events.qh

index b30a69f149156011312259e297f5477a82274abf,93d037aadae46bf43d0d2495291a4fba603bbea1..0d344b7f2d6807c96768f7b2e5eca6e819e8fb4f
@@@ -1293,19 -1220,10 +1288,10 @@@ void ClientConnect(entity this
  
        int playerid_save = this.playerid;
        this.playerid = 0; // silent
 -      JoinBestTeam(this, false); // if the team number is valid, keep it
 +      TeamBalance_JoinBestTeam(this, false); // if the team number is valid, keep it
        this.playerid = playerid_save;
  
-       if (autocvar_sv_spectate || autocvar_g_campaign || this.team_forced < 0) {
-               TRANSMUTE(Observer, this);
-       } else {
-               if (!teamplay || autocvar_g_balance_teams) {
-                       TRANSMUTE(Player, this);
-                       campaign_bots_may_start = true;
-               } else {
-                       TRANSMUTE(Observer, this); // do it anyway
-               }
-       }
+       TRANSMUTE(Observer, this);
  
        PlayerStats_GameReport_AddEvent(sprintf("kills-%d", this.playerid));
  
Simple merge
Simple merge
index df0c1d2cb94539ef3ec61309c3a869c83f2b7aea,0b800946813cd26f8a33ad1319897cfda8c4c3af..f66ebcb0eed04adfb8ccd36e064d66b1eb4e61e4
@@@ -578,63 -577,7 +577,59 @@@ STATIC_INIT_EARLY(maxclients
        }
  }
  
 +void default_delayedinit(entity this)
 +{
 +      if(!scores_initialized)
 +              ScoreRules_generic();
 +}
 +
 +void InitGameplayMode()
 +{
 +      VoteReset();
 +
 +      // find out good world mins/maxs bounds, either the static bounds found by looking for solid, or the mapinfo specified bounds
 +      get_mi_min_max(1);
 +      // assign reflectively to avoid "assignment to world" warning
 +      int done = 0; for (int i = 0, n = numentityfields(); i < n; ++i) {
 +          string k = entityfieldname(i); vector v = (k == "mins") ? mi_min : (k == "maxs") ? mi_max : '0 0 0';
 +          if (v) {
 +            putentityfieldstring(i, world, sprintf("%v", v));
 +            if (++done == 2) break;
 +        }
 +      }
 +      // currently, NetRadiant's limit is 131072 qu for each side
 +      // distance from one corner of a 131072qu cube to the opposite corner is approx. 227023 qu
 +      // set the distance according to map size but don't go over the limit to avoid issues with float precision
 +      // in case somebody makes extremely large maps
 +      max_shot_distance = min(230000, vlen(world.maxs - world.mins));
 +
 +      MapInfo_LoadMapSettings(mapname);
 +      GameRules_teams(false);
 +
 +      if (!cvar_value_issafe(world.fog))
 +      {
 +              LOG_INFO("The current map contains a potentially harmful fog setting, ignored");
 +              world.fog = string_null;
 +      }
 +      if(MapInfo_Map_fog != "")
 +              if(MapInfo_Map_fog == "none")
 +                      world.fog = string_null;
 +              else
 +                      world.fog = strzone(MapInfo_Map_fog);
 +      clientstuff = strzone(MapInfo_Map_clientstuff);
 +
 +      MapInfo_ClearTemps();
 +
 +      gamemode_name = MapInfo_Type_ToText(MapInfo_LoadedGametype);
 +
 +      cache_mutatormsg = strzone("");
 +      cache_lastmutatormsg = strzone("");
 +
 +      InitializeEntity(NULL, default_delayedinit, INITPRIO_GAMETYPE_FALLBACK);
 +}
 +
 +void Map_MarkAsRecent(string m);
  float world_already_spawned;
- void Nagger_Init();
- void ClientInit_Spawn();
- void WeaponStats_Init();
- void WeaponStats_Shutdown();
  spawnfunc(worldspawn)
  {
        server_is_dedicated = boolean(stof(cvar_defstring("is_dedicated")));
Simple merge
Simple merge