]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/waypointsprites.qc
Merge branch 'master' into Mario/ons_updates
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / waypointsprites.qc
index 02ebdec920562847fb780067d94da3a9c36267df..f0f27d3c9795b4f27dc0f0fa1d98e399de9cedf3 100644 (file)
@@ -307,12 +307,27 @@ float WaypointSprite_SendEntity(entity to, float sendflags)
                WriteCoord(MSG_ENTITY, self.fade_time);
                WriteCoord(MSG_ENTITY, self.teleport_time);
                WriteShort(MSG_ENTITY, self.fade_rate); // maxdist
-               float f;
-               f = 0;
+               float f = 0;
                if(self.currentammo)
                        f |= 1; // hideable
                if(self.exteriormodeltoclient == to)
                        f |= 2; // my own
+               if(g_onslaught)
+               {
+                       if(self.owner.classname == "onslaught_controlpoint")
+                       {
+                               entity wp_owner = self.owner;
+                               entity e = WaypointSprite_getviewentity(to);
+                               if(SAME_TEAM(e, wp_owner) && wp_owner.goalentity.health >= wp_owner.goalentity.max_health) { f |= 2; }
+                               if(!ons_ControlPoint_Attackable(wp_owner, e.team)) { f |= 2; }
+                       }
+                       if(self.owner.classname == "onslaught_generator")
+                       {
+                               entity wp_owner = self.owner;
+                               if(wp_owner.isshielded && wp_owner.health >= wp_owner.max_health) { f |= 2; }
+                               if(wp_owner.health <= 0) { f |= 2; }
+                       }
+               }
                WriteByte(MSG_ENTITY, f);
        }