]> 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 f0f27d3c9795b4f27dc0f0fa1d98e399de9cedf3..4a4d9864317dc8c643d0ce66804d638420333c07 100644 (file)
@@ -199,7 +199,14 @@ float WaypointSprite_visible_for_player(entity e)
                        return false;
 
        // team waypoints
-       if(self.team && self.rule == SPRITERULE_DEFAULT)
+       if(self.rule == SPRITERULE_SPECTATOR)
+       {
+               if(!autocvar_sv_itemstime)
+                       return FALSE;
+               if(!warmup_stage && e.classname == "player")
+                       return FALSE;
+       }
+       else if(self.team && self.rule == SPRITERULE_DEFAULT)
        {
                if(self.team != e.team)
                        return false;
@@ -241,10 +248,9 @@ float WaypointSprite_Customize()
        // this is not in SendEntity because it shall run every frame, not just every update
 
        // make spectators see what the player would see
-       entity e;
-       e = WaypointSprite_getviewentity(other);
+       entity e = WaypointSprite_getviewentity(other);
 
-       if(MUTATOR_CALLHOOK(CustomizeWaypoint))
+       if(MUTATOR_CALLHOOK(CustomizeWaypoint, self, other))
                return false;
 
        return self.waypointsprite_visible_for_player(e);
@@ -389,11 +395,11 @@ entity WaypointSprite_Spawn(
        wp.team = t;
        wp.owner = own;
        wp.currentammo = hideable;
-       if(own)
+       if (own)
        {
-               if(own.ownfield)
-                       remove(own.ownfield);
-               own.ownfield = wp;
+               if (own.(ownfield))
+                       remove(own.(ownfield));
+               own.(ownfield) = wp;
                wp.owned_by_field = ownfield;
        }
        wp.fade_rate = maxdistance;