X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fserver%2Fg_world.qc;h=52cf9643014781d260f4320cbd90851f1c758a2d;hb=8147a47b2bcf984f2f14e58f86454f343e1210ee;hp=03222059ef4835fee8ebf31c09a72b5ad70c348d;hpb=315ab0f2f959b04e5a10f2d98ab95656eab74ee3;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/g_world.qc b/qcsrc/server/g_world.qc index 03222059e..52cf96430 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); @@ -428,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 @@ -709,14 +706,6 @@ void spawnfunc_worldspawn (void) if(autocvar_g_norecoil) s = strcat(s, ":norecoil"); - // TODO to mutator system - 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"); @@ -894,7 +883,7 @@ void spawnfunc_worldspawn (void) s = ""; n = tokenize_console(cvar_string("sv_curl_serverpackages")); for(i = 0; i < n; ++i) - if(substring(argv(i), -14, -1) != "-serverpackage.txt") + if(substring(argv(i), -18, -1) != "-serverpackage.txt") if(substring(argv(i), -14, -1) != ".serverpackage") // OLD legacy s = strcat(s, " ", argv(i)); fd = search_begin("*-serverpackage.txt", TRUE, FALSE); @@ -925,9 +914,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); @@ -1339,7 +1325,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.\"", 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; } @@ -1463,11 +1449,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 || other.caplayer == 1 || g_lms) + if(IS_PLAYER(other) || g_arena || other.caplayer == 1 || g_lms) s = strcat(s, ftos(other.team), ":"); else s = strcat(s, "spectator:"); @@ -1532,7 +1518,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; @@ -1544,7 +1530,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 @@ -1581,7 +1566,7 @@ void NextLevel() PlayerStats_AddGlobalInfo(e); PlayerStats_Shutdown(); WeaponStats_Shutdown(); - + Kill_Notification(NOTIF_ALL, world, MSG_CENTER, 0); // kill all centerprints now if(autocvar_sv_eventlog) @@ -1590,7 +1575,6 @@ void NextLevel() GameLogClose(); FOR_EACH_PLAYER(other) { - minstagib_stop_countdown(other); FixIntermissionClient(other); if(other.winning) bprint(other.netname, " ^7wins.\n"); @@ -1667,7 +1651,7 @@ void InitiateOvertime() // ONLY call this if InitiateSuddenDeath returned true tl += autocvar_timelimit_overtime; cvar_set("timelimit", ftos(tl)); - Send_Notification(NOTIF_ALL, world, MSG_CENTER, CENTER_OVERTIME_TIME, autocvar_timelimit_overtime); + Send_Notification(NOTIF_ALL, world, MSG_CENTER, CENTER_OVERTIME_TIME, autocvar_timelimit_overtime * 60); } float GetWinningCode(float fraglimitreached, float equality) @@ -1725,7 +1709,7 @@ float WinningCondition_Onslaught() WinningConditionHelper(); // set worldstatus - if(inWarmupStage) + if(warmup_stage) return WINNING_NO; // first check if the game has ended @@ -1758,24 +1742,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(); @@ -2136,7 +2102,7 @@ void CheckRules_World() fraglimit = autocvar_fraglimit; leadlimit = autocvar_leadlimit; - if(inWarmupStage || time <= game_starttime) // NOTE: this is <= to prevent problems in the very tic where the game starts + if(warmup_stage || time <= game_starttime) // NOTE: this is <= to prevent problems in the very tic where the game starts { if(timelimit > 0) timelimit = 0; // timelimit is not made for warmup @@ -2702,7 +2668,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); @@ -2814,7 +2780,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;