X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fserver%2Fg_world.qc;h=3043a30003a590f713fc6561074605fbf31d236f;hb=697447ac86b204295fb2cb8bae3160b39af2ccfb;hp=ed194ef0d154cf411b7628d1837a3a20ccb07f8a;hpb=d6d9cfdafd8f5441bedf898d50e683ff976dae91;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/g_world.qc b/qcsrc/server/g_world.qc index ed194ef0d..3043a3000 100644 --- a/qcsrc/server/g_world.qc +++ b/qcsrc/server/g_world.qc @@ -14,7 +14,7 @@ void PingPLReport_Think() self.nextthink = time + delta; e = edict_num(self.cnt + 1); - if(clienttype(e) == CLIENTTYPE_REAL) + if(IS_REAL_CLIENT(e)) { WriteByte(MSG_BROADCAST, SVC_TEMPENTITY); WriteByte(MSG_BROADCAST, TE_CSQC_PINGPLREPORT); @@ -256,16 +256,17 @@ void cvar_changes_init() BADCVAR("g_arena"); BADCVAR("g_assault"); BADCVAR("g_ca"); + BADCVAR("g_ca_teams"); BADCVAR("g_ctf"); BADCVAR("g_cts"); BADCVAR("g_dm"); BADCVAR("g_domination"); BADCVAR("g_domination_default_teams"); BADCVAR("g_freezetag"); + BADCVAR("g_freezetag_teams"); BADCVAR("g_keepaway"); BADCVAR("g_keyhunt"); BADCVAR("g_keyhunt_teams"); - BADCVAR("g_keyhunt_teams"); BADCVAR("g_lms"); BADCVAR("g_nexball"); BADCVAR("g_onslaught"); @@ -359,8 +360,10 @@ void cvar_changes_init() BADCVAR("g_balance_teams_scorefactor"); BADCVAR("g_ban_sync_trusted_servers"); BADCVAR("g_ban_sync_uri"); + BADCVAR("g_ca_teams_override"); BADCVAR("g_ctf_ignore_frags"); BADCVAR("g_domination_point_limit"); + BADCVAR("g_freezetag_teams_override"); BADCVAR("g_friendlyfire"); BADCVAR("g_fullbrightitems"); BADCVAR("g_fullbrightplayers"); @@ -425,12 +428,9 @@ void cvar_changes_init() BADCVAR("g_minstagib"); BADCVAR("g_new_toys"); BADCVAR("g_nix"); - - if(autocvar_g_minstagib) - { - BADCVAR("g_grappling_hook"); - BADCVAR("g_jetpack"); - } + BADCVAR("g_grappling_hook"); + BADCVAR("g_jetpack"); + #undef BADPREFIX #undef BADCVAR @@ -581,8 +581,6 @@ void spawnfunc_worldspawn (void) compressShortVector_init(); - allowed_to_spawn = TRUE; - entity head; head = nextent(world); maxclients = 0; @@ -712,10 +710,6 @@ void spawnfunc_worldspawn (void) if(autocvar_g_midair) s = strcat(s, ":midair"); - // TODO to mutator system - if(autocvar_g_minstagib) - s = strcat(s, ":minstagib"); - // TODO to mutator system if(autocvar_g_powerups == 0) s = strcat(s, ":no_powerups"); @@ -783,6 +777,7 @@ void spawnfunc_worldspawn (void) addstat(STAT_SWITCHWEAPON, AS_INT, switchweapon); addstat(STAT_SWITCHINGWEAPON, AS_INT, switchingweapon); addstat(STAT_GAMESTARTTIME, AS_FLOAT, stat_game_starttime); + addstat(STAT_ROUNDSTARTTIME, AS_FLOAT, stat_round_starttime); addstat(STAT_ALLOW_OLDNEXBEAM, AS_INT, stat_allow_oldnexbeam); Nagger_Init(); @@ -805,19 +800,6 @@ void spawnfunc_worldspawn (void) addstat(STAT_HAGAR_LOAD, AS_INT, hagar_load); - if(g_ca || g_freezetag) - { - addstat(STAT_REDALIVE, AS_INT, redalive_stat); - addstat(STAT_BLUEALIVE, AS_INT, bluealive_stat); - addstat(STAT_YELLOWALIVE, AS_INT, yellowalive_stat); - addstat(STAT_PINKALIVE, AS_INT, pinkalive_stat); - } - if(g_freezetag) - { - addstat(STAT_FROZEN, AS_INT, freezetag_frozen); - addstat(STAT_REVIVE_PROGRESS, AS_FLOAT, freezetag_revive_progress); - } - // g_movementspeed hack addstat(STAT_MOVEVARS_AIRSPEEDLIMIT_NONQW, AS_FLOAT, stat_sv_airspeedlimit_nonqw); addstat(STAT_MOVEVARS_MAXSPEED, AS_FLOAT, stat_sv_maxspeed); @@ -936,9 +918,6 @@ void spawnfunc_worldspawn (void) modname = cvar_string("g_mod_balance"); if(cvar_string("g_mod_config") != cvar_defstring("g_mod_config")) modname = cvar_string("g_mod_config"); - // weird mutators that deserve to count as mod - if(autocvar_g_minstagib) - modname = "MinstaGib"; // extra mutators that deserve to count as mod MUTATOR_CALLHOOK(SetModname); @@ -1350,7 +1329,7 @@ void IntermissionThink() && ((self.autoscreenshot > 0) && (time > self.autoscreenshot)) ) { self.autoscreenshot = -1; - if(clienttype(self) == CLIENTTYPE_REAL) { stuffcmd(self, sprintf("\nscreenshot screenshots/autoscreenshot/%s-%s.jpg; echo \"^5A screenshot has been taken at request of the server.\"\n", GetMapname(), strftime(FALSE, "%s"))); } + if(IS_REAL_CLIENT(self)) { stuffcmd(self, sprintf("\nscreenshot screenshots/autoscreenshot/%s-%s.jpg; echo \"^5A screenshot has been taken at request of the server.\"\n", GetMapname(), strftime(FALSE, "%s"))); } return; } @@ -1474,11 +1453,11 @@ void DumpStats(float final) FOR_EACH_CLIENT(other) { - if ((clienttype(other) == CLIENTTYPE_REAL) || (clienttype(other) == CLIENTTYPE_BOT && autocvar_sv_logscores_bots)) + if ((IS_REAL_CLIENT(other)) || (IS_BOT_CLIENT(other) && autocvar_sv_logscores_bots)) { s = strcat(":player:see-labels:", GetPlayerScoreString(other, 0), ":"); s = strcat(s, ftos(rint(time - other.jointime)), ":"); - if(other.classname == "player" || g_arena || g_ca || g_lms) + if(IS_PLAYER(other) || g_arena || other.caplayer == 1 || g_lms) s = strcat(s, ftos(other.team), ":"); else s = strcat(s, "spectator:"); @@ -1543,7 +1522,7 @@ void FixIntermissionClient(entity e) if (e.weaponentity.weaponentity) e.weaponentity.weaponentity.effects = EF_NODRAW; } - if(clienttype(e) == CLIENTTYPE_REAL) + if(IS_REAL_CLIENT(e)) { stuffcmd(e, "\nscr_printspeed 1000000\n"); s = autocvar_sv_intermission_cdtrack; @@ -1555,7 +1534,6 @@ void FixIntermissionClient(entity e) } } -void minstagib_stop_countdown(entity e); /* go to the next level for deathmatch only called if a time or frag limit has expired @@ -1601,7 +1579,6 @@ void NextLevel() GameLogClose(); FOR_EACH_PLAYER(other) { - minstagib_stop_countdown(other); FixIntermissionClient(other); if(other.winning) bprint(other.netname, " ^7wins.\n"); @@ -1769,24 +1746,6 @@ float WinningCondition_Onslaught() return WINNING_NO; } -float LMS_NewPlayerLives() -{ - float fl; - fl = autocvar_fraglimit; - if(fl == 0) - fl = 999; - - // first player has left the game for dying too much? Nobody else can get in. - if(lms_lowest_lives < 1) - return 0; - - if(!autocvar_g_lms_join_anytime) - if(lms_lowest_lives < fl - autocvar_g_lms_last_join) - return 0; - - return bound(1, lms_lowest_lives, fl); -} - // Assault winning condition: If the attackers triggered a round end (by fulfilling all objectives) // they win. Otherwise the defending team wins once the timelimit passes. void assault_new_round(); @@ -2713,7 +2672,7 @@ void MapVote_Tick() { other.health = 2342; other.impulse = 0; - if(clienttype(other) == CLIENTTYPE_REAL) + if(IS_REAL_CLIENT(other)) { msg_entity = other; WriteByte(MSG_ONE, SVC_FINALE); @@ -2825,7 +2784,7 @@ void EndFrame() float altime; FOR_EACH_REALCLIENT(self) { - if(self.classname == "spectator") + if(IS_SPEC(self)) { if(self.enemy.typehitsound) self.typehit_time = time;