]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/assault.qc
More documentation and some minor changes for drag code
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / assault.qc
index 3006189834d91bc722d331cb046f034ccbfd5150..45fa5c77d43aabc688d325e9f8f6edd191cc2c7f 100644 (file)
@@ -103,7 +103,7 @@ void assault_objective_decrease_use() {
                                                centerprint(player, s);
                                        }
                                }
-                                       
+
                                oldactivator = activator;
                                activator = oldself;
                                        SUB_UseTargets();
@@ -115,7 +115,7 @@ void assault_objective_decrease_use() {
 
 void assault_setenemytoobjective()
 {
-       local entity objective;
+       entity objective;
        for(objective = world; (objective = find(objective, targetname, self.target)); ) {
                if(objective.classname == "target_objective") {
                        if(self.enemy == world)
@@ -155,7 +155,7 @@ void target_objective_decrease_activate()
                                ent.sprite = world;
                }
 
-               spr = WaypointSprite_SpawnFixed("<placeholder>", 0.5 * (ent.absmin + ent.absmax), ent, assault_sprite);
+               spr = WaypointSprite_SpawnFixed("<placeholder>", 0.5 * (ent.absmin + ent.absmax), ent, assault_sprite, RADARICON_OBJECTIVE, '1 0.5 0');
                spr.assault_decreaser = self;
                spr.waypointsprite_visible_for_player = assault_decreaser_sprite_visible;
                spr.classname = "sprite_waypoint";
@@ -169,7 +169,6 @@ void target_objective_decrease_activate()
                }
                else
                        WaypointSprite_UpdateSprites(spr, "as-defend", "as-push", "as-push");
-               WaypointSprite_UpdateTeamRadar(spr, RADARICON_OBJECTIVE, '1 0.5 0');
        }
 }
 
@@ -208,6 +207,7 @@ void spawnfunc_func_assault_destructible() {
                return;
        }
        self.spawnflags = 3;
+       self.classname = "func_assault_destructible";
        if(assault_attacker_team == COLOR_TEAM1) {
                self.team = COLOR_TEAM2;
        } else {
@@ -272,7 +272,7 @@ void assault_roundstart_use() {
        activator = self;
        SUB_UseTargets();
 
-       
+
 #ifdef TTURRETS_ENABLED
        entity ent, oldself;
 
@@ -314,9 +314,31 @@ void spawnfunc_target_assault_roundstart() {
 
 // trigger new round
 // reset objectives, toggle spawnpoints, reset triggers, ...
-void assault_new_round() {
+void vehicles_clearrturn();
+void vehicles_spawn();
+void assault_new_round()
+{
+    entity oldself;
        //bprint("ASSAULT: new round\n");
 
+       oldself = self;
+       // Eject players from vehicles
+    FOR_EACH_PLAYER(self)
+    {
+        if(self.vehicle)
+            vehicles_exit(VHEF_RELESE);
+    }
+
+    self = findchainflags(vehicle_flags, VHF_ISVEHICLE);
+    while(self)
+    {
+        vehicles_clearrturn();
+        vehicles_spawn();
+        self = self.chain;
+    }
+
+    self = oldself;
+
        // up round counter
        self.winning = self.winning + 1;
 
@@ -328,7 +350,7 @@ void assault_new_round() {
        }
 
 
-       local entity ent;
+       entity ent;
        for(ent = world; (ent = nextent(ent)); )
        {
                if(clienttype(ent) == CLIENTTYPE_NOTACLIENT)