]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/mutators/mutator/waypoints/waypointsprites.qc
mapinfo: remove some IS_GAMETYPE macros
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / mutators / mutator / waypoints / waypointsprites.qc
index b83c96a61679cf413e902ded6fc46182802be533..f0b768c5741986aca921eb5a77be1ee83e73947c 100644 (file)
@@ -12,11 +12,17 @@ bool WaypointSprite_SendEntity(entity this, entity to, float sendflags)
 
     sendflags = sendflags & 0x7F;
 
-    if (g_nexball)
-        sendflags &= ~0x80;
-    else if (self.max_health || (self.pain_finished && (time < self.pain_finished + 0.25)))
+    if (self.max_health || (self.pain_finished && (time < self.pain_finished + 0.25)))
         sendflags |= 0x80;
 
+    int f = 0;
+    if(self.currentammo)
+        f |= 1; // hideable
+    if(self.exteriormodeltoclient == to)
+        f |= 2; // my own
+
+    MUTATOR_CALLHOOK(SendWaypoint, this, to, sendflags, f);
+
     WriteByte(MSG_ENTITY, sendflags);
     WriteByte(MSG_ENTITY, self.wp_extra);
 
@@ -62,27 +68,6 @@ bool WaypointSprite_SendEntity(entity this, 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 = 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);
     }
 
@@ -993,7 +978,7 @@ void WaypointSprite_Reset()
 {SELFPARAM();
     // if a WP wants to time out, let it time out immediately; other WPs ought to be reset/killed by their owners
 
-    if (self.fade_time) // there was there before: || g_keyhunt, do we really need this?
+    if (self.fade_time)
         WaypointSprite_Kill(self);
 }