X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fserver%2Fg_world.qc;h=6efe273bd3c41c1ffd9918033fcf478397677a01;hb=76a57eeb05e207bfc833f2281e6a518e0e5086a3;hp=c2f895c48243707e166dc4fa8b823f81499bff1a;hpb=98517678e4e82b32bcdf0bfc0dbf6fbd2513f471;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/g_world.qc b/qcsrc/server/g_world.qc index c2f895c48..6efe273bd 100644 --- a/qcsrc/server/g_world.qc +++ b/qcsrc/server/g_world.qc @@ -295,9 +295,8 @@ void cvar_changes_init() BADCVAR("g_balance_kill_delay"); BADCVAR("g_ca_point_leadlimit"); BADCVAR("g_ctf_captimerecord_always"); - BADCVAR("g_ctf_flag_capture_effects"); BADCVAR("g_ctf_flag_glowtrails"); - BADCVAR("g_ctf_flag_pickup_effects"); + BADCVAR("g_ctf_flag_pickup_verbosename"); BADCVAR("g_domination_point_leadlimit"); BADCVAR("g_forced_respawn"); BADCVAR("g_keyhunt_point_leadlimit"); @@ -348,7 +347,8 @@ void cvar_changes_init() BADCVAR("gametype"); BADCVAR("g_antilag"); BADCVAR("g_balance_teams"); - BADCVAR("g_balance_teams_force"); + BADCVAR("g_balance_teams_prevent_imbalance"); + BADCVAR("g_balance_teams_scorefactor"); BADCVAR("g_ban_sync_trusted_servers"); BADCVAR("g_ban_sync_uri"); BADCVAR("g_ctf_ignore_frags"); @@ -638,6 +638,8 @@ void spawnfunc_worldspawn (void) Map_MarkAsRecent(mapname); + PlayerStats_Init(); // we need this to be initiated before InitGameplayMode + precache_model ("null"); // we need this one before InitGameplayMode InitGameplayMode(); readlevelcvars(); @@ -911,8 +913,6 @@ void spawnfunc_worldspawn (void) cvar_set("sv_curl_serverpackages", substring(s, 1, -1)); } - PlayerStats_Init(); - // MOD AUTHORS: change this, and possibly remove a few of the blocks below to ignore certain changes modname = "Xonotic"; // physics/balance/config changes that count as mod @@ -1441,6 +1441,8 @@ void DumpStats(float final) print(s, "\n"); if(to_eventlog) GameLogEcho(s); + + file = -1; if(to_file) { file = fopen(autocvar_sv_logscores_filename, FILE_APPEND); @@ -1977,6 +1979,9 @@ float WinningCondition_Scores(float limit, float leadlimit) limitreached = (limitreached || leadlimitreached); } + if(limit) + game_completion_ratio = max(game_completion_ratio, bound(0, WinningConditionHelper_topscore / limit, 1)); + return GetWinningCode( WinningConditionHelper_topscore && limitreached, WinningConditionHelper_equality @@ -2072,10 +2077,14 @@ float WinningCondition_RanOutOfSpawns() else if(team1_score + team2_score + team3_score + team4_score == 1) { float t, i; - if(team1_score) t = COLOR_TEAM1; - if(team2_score) t = COLOR_TEAM2; - if(team3_score) t = COLOR_TEAM3; - if(team4_score) t = COLOR_TEAM4; + if(team1_score) + t = COLOR_TEAM1; + else if(team2_score) + t = COLOR_TEAM2; + else if(team3_score) + t = COLOR_TEAM3; + else // if(team4_score) + t = COLOR_TEAM4; CheckAllowedTeams(world); for(i = 0; i < MAX_TEAMSCORE; ++i) { @@ -2161,6 +2170,11 @@ void CheckRules_World() float wantovertime; wantovertime = 0; + if(timelimit > game_starttime) + game_completion_ratio = (time - game_starttime) / (timelimit - game_starttime); + else + game_completion_ratio = 0; + if(checkrules_suddendeathend) { if(!checkrules_suddendeathwarning) @@ -2363,6 +2377,7 @@ void MapVote_AddVotable(string nextMap, float isSuggestion) mapvote_maps[mapvote_count] = strzone(nextMap); mapvote_maps_suggested[mapvote_count] = isSuggestion; + pakfile = string_null; for(i = 0; i < mapvote_screenshot_dirs_count; ++i) { mapfile = strcat(mapvote_screenshot_dirs[i], "/", mapvote_maps[i]);