X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fserver%2Fg_world.qc;h=9d5d4158cf720e89db41792cc679e1e200ad5a26;hb=41e9b002169cd742d5eadd4c540f55164af7f120;hp=6f0e631ea50fd6db8cddb2a7f9afb4f4064f3026;hpb=5c261e6c8b328196282545db4b6d1b85df2a12d5;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/g_world.qc b/qcsrc/server/g_world.qc index 6f0e631ea..9d5d4158c 100644 --- a/qcsrc/server/g_world.qc +++ b/qcsrc/server/g_world.qc @@ -368,7 +368,6 @@ void cvar_changes_init() BADCVAR("g_maplist_votable_nodetail"); BADCVAR("g_maplist_votable_suggestions"); BADCVAR("g_maxplayers"); - BADCVAR("g_minstagib"); BADCVAR("g_mirrordamage"); BADCVAR("g_nexball_goallimit"); BADCVAR("g_powerups"); @@ -415,6 +414,11 @@ void cvar_changes_init() BADPREFIX("g_warmup_"); BADPREFIX("sv_ready_restart_"); + // mutators that announce themselves properly to the server browser + BADCVAR("g_minstagib"); + BADCVAR("g_new_toys"); + BADCVAR("g_nix"); + if(autocvar_g_minstagib) { BADCVAR("g_grappling_hook"); @@ -545,6 +549,7 @@ void Map_MarkAsRecent(string m); float world_already_spawned; void RegisterWeapons(); void Nagger_Init(); +void Item_ItemsTime_Init(); void ClientInit_Spawn(); void WeaponStats_Init(); void WeaponStats_Shutdown(); @@ -764,7 +769,7 @@ void spawnfunc_worldspawn (void) WeaponStats_Init(); - addstat(STAT_WEAPONS, AS_INT, weapons); + WEPSET_ADDSTAT(); addstat(STAT_SWITCHWEAPON, AS_INT, switchweapon); addstat(STAT_SWITCHINGWEAPON, AS_INT, switchingweapon); addstat(STAT_GAMESTARTTIME, AS_FLOAT, stat_game_starttime); @@ -790,6 +795,17 @@ void spawnfunc_worldspawn (void) addstat(STAT_HAGAR_LOAD, AS_INT, hagar_load); + addstat(STAT_ARMOR_LARGE_TIME, AS_FLOAT, item_armor_large_time); + addstat(STAT_HEALTH_MEGA_TIME, AS_FLOAT, item_health_mega_time); + addstat(STAT_INVISIBLE_TIME, AS_FLOAT, item_invisible_time); + addstat(STAT_SPEED_TIME, AS_FLOAT, item_speed_time); + addstat(STAT_EXTRALIFE_TIME, AS_FLOAT, item_extralife_time); + addstat(STAT_STRENGTH_TIME, AS_FLOAT, item_strength_time); + addstat(STAT_SHIELD_TIME, AS_FLOAT, item_shield_time); + addstat(STAT_FUELREGEN_TIME, AS_FLOAT, item_fuelregen_time); + addstat(STAT_JETPACK_TIME, AS_FLOAT, item_jetpack_time); + Item_ItemsTime_Init(); + if(g_ca || g_freezetag) { addstat(STAT_REDALIVE, AS_INT, redalive_stat); @@ -1437,6 +1453,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); @@ -1628,7 +1646,7 @@ float InitiateSuddenDeath() // - for this timelimit_overtime needs to be >0 of course // - also check the winning condition calculated in the previous frame and only add normal overtime // again, if at the point at which timelimit would be extended again, still no winner was found - if ((checkrules_overtimesadded >= 0) && (checkrules_overtimesadded < autocvar_timelimit_overtimes) && autocvar_timelimit_overtime && !(g_race && !g_race_qualifying)) + if (!autocvar_g_campaign && (checkrules_overtimesadded >= 0) && (checkrules_overtimesadded < autocvar_timelimit_overtimes) && autocvar_timelimit_overtime && !(g_race && !g_race_qualifying)) { return 1; // need to call InitiateOvertime later } @@ -1636,7 +1654,10 @@ float InitiateSuddenDeath() { if(!checkrules_suddendeathend) { - checkrules_suddendeathend = time + 60 * autocvar_timelimit_suddendeath; + if(autocvar_g_campaign) + checkrules_suddendeathend = time; // no suddendeath in campaign + else + checkrules_suddendeathend = time + 60 * autocvar_timelimit_suddendeath; if(g_race && !g_race_qualifying) race_StartCompleting(); } @@ -2065,10 +2086,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) { @@ -2137,9 +2162,6 @@ void CheckRules_World() leadlimit = 0; // no leadlimit for now } - if(g_onslaught) - timelimit = 0; // ONS has its own overtime rule - if(timelimit > 0) { timelimit += game_starttime; @@ -2151,6 +2173,9 @@ void CheckRules_World() return; } + if(g_onslaught) + timelimit = 0; // ONS has its own overtime rule + float wantovertime; wantovertime = 0; @@ -2356,6 +2381,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]);