]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/mutators/gamemode_assault.qc
Merge branch 'master' into Mario/vehicles
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / mutators / gamemode_assault.qc
index bf2594785cff6bbb9b70e426bbd79f23902fcf8d..7b6135de60c7ffecbb1d808187f804bd3cc5738e 100644 (file)
@@ -178,10 +178,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 == NUM_TEAM_1)
+                       ent.team = NUM_TEAM_2;
                else
-                       ent.team = COLOR_TEAM1;
+                       ent.team = NUM_TEAM_1;
 
                self = ent;
 
@@ -212,7 +212,7 @@ void assault_wall_think()
 
 // trigger new round
 // reset objectives, toggle spawnpoints, reset triggers, ...
-void vehicles_clearrturn();
+void vehicles_clearreturn(entity veh);
 void vehicles_spawn();
 void assault_new_round()
 {
@@ -224,13 +224,13 @@ void assault_new_round()
     FOR_EACH_PLAYER(self)
     {
         if(self.vehicle)
-            vehicles_exit(VHEF_RELESE);
+            vehicles_exit(VHEF_RELEASE);
     }
 
     self = findchainflags(vehicle_flags, VHF_ISVEHICLE);
     while(self)
     {
-        vehicles_clearrturn();
+        vehicles_clearreturn(self);
         vehicles_spawn();
         self = self.chain;
     }
@@ -241,20 +241,20 @@ 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 == NUM_TEAM_1)
+               assault_attacker_team = NUM_TEAM_2;
        else
-               assault_attacker_team = COLOR_TEAM1;
+               assault_attacker_team = NUM_TEAM_1;
 
        entity ent;
        for(ent = world; (ent = nextent(ent)); )
        {
                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 == NUM_TEAM_1)
+                               ent.team_saved = NUM_TEAM_2;
+                       else if(ent.team_saved == NUM_TEAM_2)
+                               ent.team_saved = NUM_TEAM_1;
                }
        }
 
@@ -266,24 +266,24 @@ void assault_new_round()
 // spawnfuncs
 void spawnfunc_info_player_attacker()
 {
-       if not(g_assault) { remove(self); return; }
-       
-       self.team = COLOR_TEAM1; // red, gets swapped every round
+       if (!g_assault) { remove(self); return; }
+
+       self.team = NUM_TEAM_1; // red, gets swapped every round
        spawnfunc_info_player_deathmatch();
 }
 
 void spawnfunc_info_player_defender()
 {
-       if not(g_assault) { remove(self); return; }
-       
-       self.team = COLOR_TEAM2; // blue, gets swapped every round
+       if (!g_assault) { remove(self); return; }
+
+       self.team = NUM_TEAM_2; // blue, gets swapped every round
        spawnfunc_info_player_deathmatch();
 }
 
 void spawnfunc_target_objective()
 {
-       if not(g_assault) { remove(self); return; }
-       
+       if (!g_assault) { remove(self); return; }
+
        self.classname = "target_objective";
        self.use = assault_objective_use;
        assault_objective_reset();
@@ -293,7 +293,7 @@ void spawnfunc_target_objective()
 
 void spawnfunc_target_objective_decrease()
 {
-       if not(g_assault) { remove(self); return; }
+       if (!g_assault) { remove(self); return; }
 
        self.classname = "target_objective_decrease";
 
@@ -311,23 +311,23 @@ void spawnfunc_target_objective_decrease()
 // destructible walls that can be used to trigger target_objective_decrease
 void spawnfunc_func_assault_destructible()
 {
-       if not(g_assault) { remove(self); return; }
-       
+       if (!g_assault) { remove(self); return; }
+
        self.spawnflags = 3;
        self.classname = "func_assault_destructible";
-       
-       if(assault_attacker_team == COLOR_TEAM1)
-               self.team = COLOR_TEAM2;
+
+       if(assault_attacker_team == NUM_TEAM_1)
+               self.team = NUM_TEAM_2;
        else
-               self.team = COLOR_TEAM1;
+               self.team = NUM_TEAM_1;
 
        spawnfunc_func_breakable();
 }
 
 void spawnfunc_func_assault_wall()
 {
-       if not(g_assault) { remove(self); return; }
-       
+       if (!g_assault) { remove(self); return; }
+
        self.classname = "func_assault_wall";
        self.mdl = self.model;
        setmodel(self, self.mdl);
@@ -339,7 +339,7 @@ void spawnfunc_func_assault_wall()
 
 void spawnfunc_target_assault_roundend()
 {
-       if not(g_assault) { remove(self); return; }
+       if (!g_assault) { remove(self); return; }
 
        self.winning = 0; // round not yet won by attackers
        self.classname = "target_assault_roundend";
@@ -350,9 +350,9 @@ void spawnfunc_target_assault_roundend()
 
 void spawnfunc_target_assault_roundstart()
 {
-       if not(g_assault) { remove(self); return; }
-       
-       assault_attacker_team = COLOR_TEAM1;
+       if (!g_assault) { remove(self); return; }
+
+       assault_attacker_team = NUM_TEAM_1;
        self.classname = "target_assault_roundstart";
        self.use = assault_roundstart_use;
        self.reset2 = assault_roundstart_use;
@@ -373,7 +373,7 @@ void havocbot_goalrating_ast_targets(float ratingscale)
                if (ad.target == "")
                        continue;
 
-               if not(ad.bot_attack)
+               if (!ad.bot_attack)
                        continue;
 
                found = FALSE;
@@ -549,13 +549,13 @@ MUTATOR_HOOKFUNCTION(assault_PlayerSpawn)
                centerprint(self, "You are attacking!");
        else
                centerprint(self, "You are defending!");
-               
+
        return FALSE;
 }
 
 MUTATOR_HOOKFUNCTION(assault_TurretSpawn)
 {
-       if not (self.team)
+       if (!self.team)
                self.team = 14;
 
        return FALSE;
@@ -589,7 +589,7 @@ MUTATOR_DEFINITION(gamemode_assault)
        MUTATOR_HOOK(TurretSpawn, assault_TurretSpawn, CBC_ORDER_ANY);
        MUTATOR_HOOK(VehicleSpawn, assault_VehicleSpawn, CBC_ORDER_ANY);
        MUTATOR_HOOK(HavocBot_ChooseRule, assault_BotRoles, CBC_ORDER_ANY);
-       
+
        MUTATOR_ONADD
        {
                if(time > 1) // game loads at time 1