X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fserver%2Fg_world.qc;h=712f301827b2183dffa612bc46b3084fad711e6a;hb=301453d310eb2454cb4fedf0e7486c6616ef2e3f;hp=7161a5be86c9b124f84ca088819e8a4d3a7c689f;hpb=35e8f712933b0ebf9b163b7289cf975825b33803;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/g_world.qc b/qcsrc/server/g_world.qc index 7161a5be8..712f30182 100644 --- a/qcsrc/server/g_world.qc +++ b/qcsrc/server/g_world.qc @@ -1,9 +1,10 @@ +#include "g_world.qh" + +#include "../common/buffs.qh" + #if defined(CSQC) #elif defined(MENUQC) #elif defined(SVQC) - #include "../dpdefs/progsdefs.qh" - #include "../dpdefs/dpextensions.qh" - #include "sys-post.qh" #include "../common/constants.qh" #include "../common/stats.qh" #include "../common/teams.qh" @@ -313,15 +314,21 @@ void cvar_changes_init() // does nothing visible BADCVAR("captureleadlimit_override"); BADCVAR("g_balance_kill_delay"); + BADCVAR("g_ca_point_limit"); BADCVAR("g_ca_point_leadlimit"); BADCVAR("g_ctf_captimerecord_always"); BADCVAR("g_ctf_flag_glowtrails"); BADCVAR("g_ctf_flag_pickup_verbosename"); BADCVAR("g_domination_point_leadlimit"); BADCVAR("g_forced_respawn"); + BADCVAR("g_freezetag_point_limit"); + BADCVAR("g_freezetag_point_leadlimit"); BADCVAR("g_keyhunt_point_leadlimit"); BADPREFIX("g_mod_"); + BADCVAR("g_invasion_point_limit"); BADCVAR("g_nexball_goalleadlimit"); + BADCVAR("g_tdm_point_limit"); + BADCVAR("g_tdm_point_leadlimit"); BADCVAR("leadlimit_and_fraglimit"); BADCVAR("leadlimit_override"); BADCVAR("pausable"); @@ -475,7 +482,7 @@ void detect_maptype() vector o, v; float i; - for(0;;) + for (;;) { o = world.mins; o.x += random() * (world.maxs.x - world.mins.x); @@ -502,7 +509,7 @@ void detect_maptype() } entity randomseed; -float RandomSeed_Send(entity to, float sf) +float RandomSeed_Send(entity to, int sf) { WriteByte(MSG_ENTITY, ENT_CLIENT_RANDOMSEED); WriteShort(MSG_ENTITY, self.cnt); @@ -569,7 +576,7 @@ void WeaponStats_Init(); void WeaponStats_Shutdown(); void spawnfunc_worldspawn (void) { - float fd, l, i, j, n; + float fd, l, j, n; string s; cvar = cvar_normal; @@ -679,7 +686,7 @@ void spawnfunc_worldspawn (void) // character set: ASCII 33-126 without the following characters: : ; ' " \ $ if(autocvar_sv_eventlog) { - s = sprintf("%d.%s.%06d", ftos(autocvar_sv_eventlog_files_counter), strftime(false, "%s"), floor(random() * 1000000)); + s = sprintf("%d.%s.%06d", itos(autocvar_sv_eventlog_files_counter), strftime(false, "%s"), floor(random() * 1000000)); matchid = strzone(s); GameLogEcho(strcat(":gamestart:", GetGametype(), "_", GetMapname(), ":", s)); @@ -800,7 +807,7 @@ void spawnfunc_worldspawn (void) addstat(STAT_VORTEX_CHARGEPOOL, AS_FLOAT, vortex_chargepool_ammo); addstat(STAT_HAGAR_LOAD, AS_INT, hagar_load); - + addstat(STAT_ARC_HEAT, AS_FLOAT, arc_heat_percent); // freeze attacks @@ -832,7 +839,7 @@ void spawnfunc_worldspawn (void) maplist_reply = strzone(getmaplist()); lsmaps_reply = strzone(getlsmaps()); monsterlist_reply = strzone(getmonsterlist()); - for(i = 0; i < 10; ++i) + for(int i = 0; i < 10; ++i) { s = getrecords(i); if (s) @@ -855,7 +862,7 @@ void spawnfunc_worldspawn (void) { s = ""; n = tokenize_console(cvar_string("sv_curl_serverpackages")); - for(i = 0; i < n; ++i) + for(int i = 0; i < n; ++i) if(substring(argv(i), -18, -1) != "-serverpackage.txt") if(substring(argv(i), -14, -1) != ".serverpackage") // OLD legacy s = strcat(s, " ", argv(i)); @@ -863,7 +870,7 @@ void spawnfunc_worldspawn (void) if(fd >= 0) { j = search_getsize(fd); - for(i = 0; i < j; ++i) + for(int i = 0; i < j; ++i) s = strcat(s, " ", search_getfilename(fd, i)); search_end(fd); } @@ -871,7 +878,7 @@ void spawnfunc_worldspawn (void) if(fd >= 0) { j = search_getsize(fd); - for(i = 0; i < j; ++i) + for(int i = 0; i < j; ++i) s = strcat(s, " ", search_getfilename(fd, i)); search_end(fd); } @@ -1237,7 +1244,7 @@ float DoNextMapOverride(float reinit) string m; m = GameTypeVote_MapInfo_FixName(autocvar_nextmap); cvar_set("nextmap",m); - + if(!m || gametypevote) return false; if(autocvar_sv_vote_gametype) @@ -1245,7 +1252,7 @@ float DoNextMapOverride(float reinit) Map_Goto_SetStr(m); return false; } - + if(MapInfo_CheckMap(m)) { Map_Goto_SetStr(m); @@ -1579,15 +1586,6 @@ void CheckRules_Player() // (div0: and that in CheckRules_World please) } -float checkrules_equality; -float checkrules_suddendeathwarning; -float checkrules_suddendeathend; -float checkrules_overtimesadded; //how many overtimes have been already added - -const float WINNING_NO = 0; // no winner, but time limits may terminate the game -const float WINNING_YES = 1; // winner found -const float WINNING_NEVER = 2; // no winner, enter overtime if time limit is reached -const float WINNING_STARTSUDDENDEATHOVERTIME = 3; // no winner, enter suddendeath overtime NOW float InitiateSuddenDeath() { @@ -1966,7 +1964,7 @@ float WinningCondition_RanOutOfSpawns() if(have_team_spawns <= 0) return WINNING_NO; - if(autocvar_g_spawn_useallspawns <= 0) + if(!autocvar_g_spawn_useallspawns) return WINNING_NO; if(!some_spawn_has_been_used)