From: Lyberta Date: Fri, 15 Jun 2018 04:51:33 +0000 (+0300) Subject: Merge branch 'master' into Lyberta/TeamplayOverhaul X-Git-Tag: xonotic-v0.8.5~1953^2~10 X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=commitdiff_plain;h=13832240e226eba119844d7bd02ca51b617e586a Merge branch 'master' into Lyberta/TeamplayOverhaul --- 13832240e226eba119844d7bd02ca51b617e586a diff --cc qcsrc/server/client.qc index b30a69f149,93d037aada..0d344b7f2d --- a/qcsrc/server/client.qc +++ b/qcsrc/server/client.qc @@@ -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)); diff --cc qcsrc/server/g_world.qc index df0c1d2cb9,0b80094681..f66ebcb0ee --- a/qcsrc/server/g_world.qc +++ b/qcsrc/server/g_world.qc @@@ -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")));