X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fserver%2Fassault.qc;h=b4ac4a1eea33ef75b19532a339ac53aa418741a2;hb=c545b26a7c733e02bfac2aad2a52ffd747202ba9;hp=45fa5c77d43aabc688d325e9f8f6edd191cc2c7f;hpb=fb61c977ddeed686ef587fd54e40f55a4bdc2322;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/assault.qc b/qcsrc/server/assault.qc index 45fa5c77d..b4ac4a1ee 100644 --- a/qcsrc/server/assault.qc +++ b/qcsrc/server/assault.qc @@ -9,7 +9,7 @@ void spawnfunc_info_player_attacker() { remove(self); return; } - self.team = COLOR_TEAM1; // red, gets swapped every round + self.team = FL_TEAM_1; // red, gets swapped every round spawnfunc_info_player_deathmatch(); } @@ -19,7 +19,7 @@ void spawnfunc_info_player_defender() { remove(self); return; } - self.team = COLOR_TEAM2; // blue, gets swapped every round + self.team = FL_TEAM_2; // blue, gets swapped every round spawnfunc_info_player_deathmatch(); } @@ -47,6 +47,13 @@ void assault_objective_use() { self = oldself; } +vector target_objective_spawn_evalfunc(entity player, entity spot, vector current) +{ + if(self.health < 0 || self.health >= ASSAULT_VALUE_INACTIVE) + return '-1 0 0'; + return current; +} + void spawnfunc_target_objective() { if(!g_assault) { @@ -57,6 +64,7 @@ void spawnfunc_target_objective() { self.use = assault_objective_use; assault_objective_reset(); self.reset = assault_objective_reset; + self.spawn_evalfunc = target_objective_spawn_evalfunc; } @@ -208,10 +216,10 @@ void spawnfunc_func_assault_destructible() { } self.spawnflags = 3; self.classname = "func_assault_destructible"; - if(assault_attacker_team == COLOR_TEAM1) { - self.team = COLOR_TEAM2; + if(assault_attacker_team == FL_TEAM_1) { + self.team = FL_TEAM_2; } else { - self.team = COLOR_TEAM1; + self.team = FL_TEAM_1; } spawnfunc_func_breakable(); } @@ -281,10 +289,10 @@ void assault_roundstart_use() { ent = find(world, classname, "turret_main"); while(ent) { // Swap turret teams - if(ent.team == COLOR_TEAM1) - ent.team = COLOR_TEAM2; + if(ent.team == FL_TEAM_1) + ent.team = FL_TEAM_2; else - ent.team = COLOR_TEAM1; + ent.team = FL_TEAM_1; self = ent; @@ -305,7 +313,7 @@ void spawnfunc_target_assault_roundstart() { remove(self); return; } - assault_attacker_team = COLOR_TEAM1; + assault_attacker_team = FL_TEAM_1; self.classname = "target_assault_roundstart"; self.use = assault_roundstart_use; self.reset2 = assault_roundstart_use; @@ -343,10 +351,10 @@ void assault_new_round() self.winning = self.winning + 1; // swap attacker/defender roles - if(assault_attacker_team == COLOR_TEAM1) { - assault_attacker_team = COLOR_TEAM2; + if(assault_attacker_team == FL_TEAM_1) { + assault_attacker_team = FL_TEAM_2; } else { - assault_attacker_team = COLOR_TEAM1; + assault_attacker_team = FL_TEAM_1; } @@ -355,14 +363,14 @@ void assault_new_round() { if(clienttype(ent) == CLIENTTYPE_NOTACLIENT) { - if(ent.team_saved == COLOR_TEAM1) - ent.team_saved = COLOR_TEAM2; - else if(ent.team_saved == COLOR_TEAM2) - ent.team_saved = COLOR_TEAM1; + if(ent.team_saved == FL_TEAM_1) + ent.team_saved = FL_TEAM_2; + else if(ent.team_saved == FL_TEAM_2) + ent.team_saved = FL_TEAM_1; } } // reset the level with a countdown cvar_set("timelimit", ftos(ceil(time - game_starttime) / 60)); - ReadyRestartForce(); // sets game_starttime + ReadyRestart_force(); // sets game_starttime }