X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=blobdiff_plain;f=qcsrc%2Fserver%2Fg_world.qc;h=25cd566587e051965be60b23d6a586b0366fff63;hp=001fbc5bb5d2d5dd718bbd188eddbf1a4dd5c307;hb=1e2f823dc628142f911534570b196e61eb3521f0;hpb=8db035f374df1c19ea24531f8a96f04625f5f559 diff --git a/qcsrc/server/g_world.qc b/qcsrc/server/g_world.qc index 001fbc5bb..25cd56658 100644 --- a/qcsrc/server/g_world.qc +++ b/qcsrc/server/g_world.qc @@ -271,7 +271,6 @@ void cvar_changes_init() BADCVAR("g_onslaught"); BADCVAR("g_race"); BADCVAR("g_race_qualifying_timelimit"); - BADCVAR("g_runematch"); BADCVAR("g_tdm"); BADCVAR("g_tdm_teams"); BADCVAR("leadlimit"); @@ -315,7 +314,6 @@ void cvar_changes_init() BADCVAR("g_keyhunt_point_leadlimit"); BADPREFIX("g_mod_"); BADCVAR("g_nexball_goalleadlimit"); - BADCVAR("g_runematch_point_leadlimit"); BADCVAR("leadlimit_and_fraglimit"); BADCVAR("leadlimit_override"); BADCVAR("pausable"); @@ -340,9 +338,6 @@ void cvar_changes_init() BADCVAR("gameversion"); BADPREFIX("gameversion_"); BADCVAR("sv_namechangetimer"); -#ifndef NO_LEGACY_NETWORKING - BADCVAR("sv_use_csqc_players"); // transition -#endif // allowed changes to server admins (please sync this to server.cfg) // vi commands: @@ -384,7 +379,6 @@ void cvar_changes_init() BADCVAR("g_mirrordamage"); BADCVAR("g_nexball_goallimit"); BADCVAR("g_powerups"); - BADCVAR("g_runematch_point_limit"); BADCVAR("g_start_delay"); BADCVAR("g_warmup"); BADCVAR("g_weapon_stay"); BADPRESUFFIX("g_", "_weapon_stay"); @@ -598,6 +592,8 @@ void spawnfunc_worldspawn (void) head = nextent(head); } + server_is_dedicated = (stof(cvar_defstring("is_dedicated")) ? TRUE : FALSE); + // needs to be done so early because of the constants they create CALL_ACCUMULATED_FUNCTION(RegisterWeapons); CALL_ACCUMULATED_FUNCTION(RegisterGametypes); @@ -673,9 +669,6 @@ void spawnfunc_worldspawn (void) WaypointSprite_Init(); - //if (g_domination) - // dom_init(); - GameLogInit(); // prepare everything // NOTE for matchid: // changing the logic generating it is okay. But: @@ -848,7 +841,7 @@ void spawnfunc_worldspawn (void) for(i = 0, j = 0; i < MapInfo_count; ++i) { if(MapInfo_Get_ByID(i)) - if not(MapInfo_Map_flags & (MAPINFO_FLAG_HIDDEN | MAPINFO_FLAG_FORBIDDEN)) + if not(MapInfo_Map_flags & MapInfo_ForbiddenFlags()) { if(mod(i, 2)) col = "^2"; @@ -948,9 +941,7 @@ void spawnfunc_worldspawn (void) modname = "MinstaGib"; // extra mutators that deserve to count as mod MUTATOR_CALLHOOK(SetModname); - // weird game types that deserve to count as mod - if(g_cts) - modname = "CTS"; + // save it for later modname = strzone(modname); @@ -1602,6 +1593,8 @@ void NextLevel() PlayerStats_Shutdown(); WeaponStats_Shutdown(); + Kill_Notification(NOTIF_ALL, world, MSG_CENTER, 0); // kill all centerprints now + if(autocvar_sv_eventlog) GameLogEcho(":gameover"); @@ -1684,20 +1677,8 @@ void InitiateOvertime() // ONLY call this if InitiateSuddenDeath returned true tl = autocvar_timelimit; tl += autocvar_timelimit_overtime; cvar_set("timelimit", ftos(tl)); - string minutesPlural; - if (autocvar_timelimit_overtime == 1) - minutesPlural = " ^3minute"; - else - minutesPlural = " ^3minutes"; - - bcenterprint( - strcat( - "^3Now playing ^1OVERTIME^3!\n\n^3Added ^1", - ftos(autocvar_timelimit_overtime), - minutesPlural, - " to the game!" - ) - ); + + Send_Notification(NOTIF_ALL, world, MSG_CENTER, CENTER_OVERTIME_TIME, autocvar_timelimit_overtime); } float GetWinningCode(float fraglimitreached, float equality) @@ -1765,10 +1746,10 @@ float WinningCondition_Onslaught() { if (head.health > 0) { - if (head.team == FL_TEAM_1) t1 = 1; - if (head.team == FL_TEAM_2) t2 = 1; - if (head.team == FL_TEAM_3) t3 = 1; - if (head.team == FL_TEAM_4) t4 = 1; + if (head.team == NUM_TEAM_1) t1 = 1; + if (head.team == NUM_TEAM_2) t2 = 1; + if (head.team == NUM_TEAM_3) t3 = 1; + if (head.team == NUM_TEAM_4) t4 = 1; } head = find(head, classname, "onslaught_generator"); } @@ -1776,10 +1757,10 @@ float WinningCondition_Onslaught() { // game over, only one team remains (or none) ClearWinners(); - if (t1) SetWinners(team, FL_TEAM_1); - if (t2) SetWinners(team, FL_TEAM_2); - if (t3) SetWinners(team, FL_TEAM_3); - if (t4) SetWinners(team, FL_TEAM_4); + if (t1) SetWinners(team, NUM_TEAM_1); + if (t2) SetWinners(team, NUM_TEAM_2); + if (t3) SetWinners(team, NUM_TEAM_3); + if (t4) SetWinners(team, NUM_TEAM_4); dprint("Have a winner, ending game.\n"); return WINNING_YES; } @@ -1817,13 +1798,13 @@ float WinningCondition_Assault() status = WINNING_NO; // as the timelimit has not yet passed just assume the defending team will win - if(assault_attacker_team == FL_TEAM_1) + if(assault_attacker_team == NUM_TEAM_1) { - SetWinners(team, FL_TEAM_2); + SetWinners(team, NUM_TEAM_2); } else { - SetWinners(team, FL_TEAM_1); + SetWinners(team, NUM_TEAM_1); } entity ent; @@ -1949,10 +1930,10 @@ float WinningCondition_Scores(float limit, float leadlimit) if(teamplay) { - team1_score = TeamScore_GetCompareValue(FL_TEAM_1); - team2_score = TeamScore_GetCompareValue(FL_TEAM_2); - team3_score = TeamScore_GetCompareValue(FL_TEAM_3); - team4_score = TeamScore_GetCompareValue(FL_TEAM_4); + team1_score = TeamScore_GetCompareValue(NUM_TEAM_1); + team2_score = TeamScore_GetCompareValue(NUM_TEAM_2); + team3_score = TeamScore_GetCompareValue(NUM_TEAM_3); + team4_score = TeamScore_GetCompareValue(NUM_TEAM_4); } ClearWinners(); @@ -1980,11 +1961,11 @@ float WinningCondition_Scores(float limit, float leadlimit) if (limit) if (leaderfrags == limit - 1) - Announce("1fragleft"); + Send_Notification(NOTIF_ALL, world, MSG_ANNCE, ANNCE_REMAINING_FRAG_1); else if (leaderfrags == limit - 2) - Announce("2fragsleft"); + Send_Notification(NOTIF_ALL, world, MSG_ANNCE, ANNCE_REMAINING_FRAG_2); else if (leaderfrags == limit - 3) - Announce("3fragsleft"); + Send_Notification(NOTIF_ALL, world, MSG_ANNCE, ANNCE_REMAINING_FRAG_3); } } @@ -2068,25 +2049,25 @@ float WinningCondition_RanOutOfSpawns() FOR_EACH_PLAYER(head) if(head.deadflag == DEAD_NO) { - if(head.team == FL_TEAM_1) + if(head.team == NUM_TEAM_1) team1_score = 1; - else if(head.team == FL_TEAM_2) + else if(head.team == NUM_TEAM_2) team2_score = 1; - else if(head.team == FL_TEAM_3) + else if(head.team == NUM_TEAM_3) team3_score = 1; - else if(head.team == FL_TEAM_4) + else if(head.team == NUM_TEAM_4) team4_score = 1; } for(head = world; (head = find(head, classname, "info_player_deathmatch")) != world; ) { - if(head.team == FL_TEAM_1) + if(head.team == NUM_TEAM_1) team1_score = 1; - else if(head.team == FL_TEAM_2) + else if(head.team == NUM_TEAM_2) team2_score = 1; - else if(head.team == FL_TEAM_3) + else if(head.team == NUM_TEAM_3) team3_score = 1; - else if(head.team == FL_TEAM_4) + else if(head.team == NUM_TEAM_4) team4_score = 1; } @@ -2100,20 +2081,20 @@ float WinningCondition_RanOutOfSpawns() { float t, i; if(team1_score) - t = FL_TEAM_1; + t = NUM_TEAM_1; else if(team2_score) - t = FL_TEAM_2; + t = NUM_TEAM_2; else if(team3_score) - t = FL_TEAM_3; + t = NUM_TEAM_3; else // if(team4_score) - t = FL_TEAM_4; + t = NUM_TEAM_4; CheckAllowedTeams(world); for(i = 0; i < MAX_TEAMSCORE; ++i) { - if(t != FL_TEAM_1) if(c1 >= 0) TeamScore_AddToTeam(FL_TEAM_1, i, -1000); - if(t != FL_TEAM_2) if(c2 >= 0) TeamScore_AddToTeam(FL_TEAM_2, i, -1000); - if(t != FL_TEAM_3) if(c3 >= 0) TeamScore_AddToTeam(FL_TEAM_3, i, -1000); - if(t != FL_TEAM_4) if(c4 >= 0) TeamScore_AddToTeam(FL_TEAM_4, i, -1000); + if(t != NUM_TEAM_1) if(c1 >= 0) TeamScore_AddToTeam(NUM_TEAM_1, i, -1000); + if(t != NUM_TEAM_2) if(c2 >= 0) TeamScore_AddToTeam(NUM_TEAM_2, i, -1000); + if(t != NUM_TEAM_3) if(c3 >= 0) TeamScore_AddToTeam(NUM_TEAM_3, i, -1000); + if(t != NUM_TEAM_4) if(c4 >= 0) TeamScore_AddToTeam(NUM_TEAM_4, i, -1000); } AddWinners(team, t); @@ -2203,9 +2184,9 @@ void CheckRules_World() { checkrules_suddendeathwarning = TRUE; if(g_race && !g_race_qualifying) - bcenterprint("^3Everyone, finish your lap! The race is over!"); + Send_Notification(NOTIF_ALL, world, MSG_CENTER, CENTER_RACE_FINISHLAP); else - bcenterprint("^3Now playing ^1OVERTIME^3!\n\n^3Keep fragging until we have a ^1winner^3!"); + Send_Notification(NOTIF_ALL, world, MSG_CENTER, CENTER_OVERTIME_FRAG); } } else