]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/mutators/gamemode_onslaught.qc
Butcher another hidden gamemode specific block
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / mutators / gamemode_onslaught.qc
index cc6ad200cd05c4d01e5be035ab72e5f0f2832a54..68318f4d6b97c72149260ecee961021a63d31bc1 100644 (file)
@@ -2044,6 +2044,28 @@ MUTATOR_HOOKFUNCTION(ons, PlayHitsound)
                || (frag_victim.classname == "onslaught_controlpoint_icon" && !frag_victim.owner.isshielded);
 }
 
+MUTATOR_HOOKFUNCTION(ons, SendWaypoint)
+{
+       if(wp_sendflags & 16)
+       {
+               if(self.owner.classname == "onslaught_controlpoint")
+               {
+                       entity wp_owner = self.owner;
+                       entity e = WaypointSprite_getviewentity(wp_sendto);
+                       if(SAME_TEAM(e, wp_owner) && wp_owner.goalentity.health >= wp_owner.goalentity.max_health) { wp_flag |= 2; }
+                       if(!ons_ControlPoint_Attackable(wp_owner, e.team)) { wp_flag |= 2; }
+               }
+               if(self.owner.classname == "onslaught_generator")
+               {
+                       entity wp_owner = self.owner;
+                       if(wp_owner.isshielded && wp_owner.health >= wp_owner.max_health) { wp_flag |= 2; }
+                       if(wp_owner.health <= 0) { wp_flag |= 2; }
+               }
+       }
+
+       return false;
+}
+
 // ==========
 // Spawnfuncs
 // ==========