X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fserver%2Fg_world.qc;h=25f86a63d942169770945128c92e020900658317;hb=6f37a8f8076a572097afb13de2c367a72717c927;hp=4be37896472c8c85cae03654088a5c1f6e46eb53;hpb=74941aea60c6fb7d875403113249410ee8af7c5e;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/g_world.qc b/qcsrc/server/g_world.qc index 4be378964..25f86a63d 100644 --- a/qcsrc/server/g_world.qc +++ b/qcsrc/server/g_world.qc @@ -1,39 +1,38 @@ #include "g_world.qh" - +#include "_.qh" + +#include "anticheat.qh" +#include "antilag.qh" +#include "bot/bot.qh" +#include "campaign.qh" +#include "cheats.qh" +#include "cl_client.qh" +#include "command/common.qh" +#include "command/getreplies.qh" +#include "command/sv_cmd.qh" +#include "command/vote.qh" +#include "g_hook.qh" +#include "ipban.qh" +#include "mapvoting.qh" +#include "mutators/mutators_include.qh" +#include "race.qh" +#include "scores.qh" +#include "secret.qh" +#include "teamplay.qh" +#include "waypointsprites.qh" +#include "weapons/weaponstats.qh" #include "../common/buffs.qh" - -#if defined(CSQC) -#elif defined(MENUQC) -#elif defined(SVQC) - #include "../common/constants.qh" - #include "../common/stats.qh" - #include "../common/teams.qh" - #include "../common/util.qh" - #include "../common/monsters/sv_monsters.qh" - #include "../common/weapons/weapons.qh" - #include "weapons/weaponstats.qh" - #include "autocvars.qh" - #include "constants.qh" - #include "defs.qh" - #include "../common/notifications.qh" - #include "mutators/mutators_include.qh" - #include "campaign.qh" - #include "../common/mapinfo.qh" - #include "command/common.qh" - #include "command/vote.qh" - #include "command/getreplies.qh" - #include "command/sv_cmd.qh" - #include "anticheat.qh" - #include "cheats.qh" - #include "../common/playerstats.qh" - #include "g_hook.qh" - #include "scores.qh" - #include "mapvoting.qh" - #include "ipban.qh" - #include "race.qh" - #include "antilag.qh" - #include "secret.qh" -#endif +#include "../common/constants.qh" +#include "../common/deathtypes.qh" +#include "../common/mapinfo.qh" +#include "../common/monsters/monsters.qh" +#include "../common/monsters/sv_monsters.qh" +#include "../common/notifications.qh" +#include "../common/playerstats.qh" +#include "../common/stats.qh" +#include "../common/teams.qh" +#include "../common/util.qh" +#include "../common/weapons/weapons.qh" const float LATENCY_THINKRATE = 10; .float latency_sum; @@ -93,9 +92,7 @@ string redirection_target; float world_initialized; string GetGametype(); -void GotoNextMap(float reinit); void ShuffleMaplist(); -float(float reinit) DoNextMapOverride; void SetDefaultAlpha() { @@ -314,15 +311,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"); @@ -476,7 +479,7 @@ void detect_maptype() vector o, v; float i; - for(0;;) + for (;;) { o = world.mins; o.x += random() * (world.maxs.x - world.mins.x); @@ -503,7 +506,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); @@ -570,7 +573,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; @@ -680,7 +683,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)); @@ -801,7 +804,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 @@ -833,7 +836,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) @@ -856,7 +859,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)); @@ -864,7 +867,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); } @@ -872,7 +875,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); } @@ -1238,7 +1241,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) @@ -1246,7 +1249,7 @@ float DoNextMapOverride(float reinit) Map_Goto_SetStr(m); return false; } - + if(MapInfo_CheckMap(m)) { Map_Goto_SetStr(m); @@ -1644,7 +1647,7 @@ void SetWinners(.float field, float value) { entity head; FOR_EACH_PLAYER(head) - head.winning = (head.field == value); + head.winning = (head.(field) == value); } // set the .winning flag for those players with a given field value @@ -1652,7 +1655,7 @@ void AddWinners(.float field, float value) { entity head; FOR_EACH_PLAYER(head) - if(head.field == value) + if (head.(field) == value) head.winning = 1; } @@ -1958,7 +1961,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) @@ -2030,7 +2033,6 @@ CheckRules_World Exit deathmatch games upon conditions ============ */ -void ReadyRestart(); void CheckRules_World() { float timelimit;