]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/client/tturrets.qc
Merge branch 'master' of /var/cache/git/xonotic/xonotic-data.pk3dir
[xonotic/xonotic-data.pk3dir.git] / qcsrc / client / tturrets.qc
index e81a1c398bbd84211ce3e0066c1b18932a809cba..2b9ec0297b2ef63411d210cc8a8597bc8438691f 100644 (file)
@@ -264,7 +264,7 @@ void turret_draw2d()
         return;
 
        string spriteimage = self.netname;
-       float t = (GetPlayerColor(player_localentnum - 1) + 1); 
+       float t = (GetPlayerColor(player_localnum) + 1);        
        float a = self.alpha * autocvar_hud_panel_fg_alpha;
        vector rgb = spritelookupcolor(spriteimage, self.teamradar_color);
 
@@ -322,7 +322,7 @@ void turret_draw2d()
        o_z = 0;
 
        float edgedistance_min, crosshairdistance;
-               edgedistance_min = min4((o_y - (vid_conheight * waypointsprite_edgeoffset_top)), 
+               edgedistance_min = min((o_y - (vid_conheight * waypointsprite_edgeoffset_top)), 
        (o_x - (vid_conwidth * waypointsprite_edgeoffset_left)),
        (vid_conwidth - (vid_conwidth * waypointsprite_edgeoffset_right)) - o_x, 
        (vid_conheight - (vid_conheight * waypointsprite_edgeoffset_bottom)) - o_y);
@@ -604,6 +604,9 @@ void ent_turret()
     
     if(sf & TNSF_ANG)
     {
+        if(self.tur_head == world) // aparenly this can happpen before TNSF_SETUP. great.
+            self.tur_head = spawn();
+            
         self.tur_head.move_angles_x = ReadShort();
         self.tur_head.move_angles_y = ReadShort();
         //self.tur_head.angles = self.angles + self.tur_head.move_angles;
@@ -612,6 +615,9 @@ void ent_turret()
     
     if(sf & TNSF_AVEL)
     {
+        if(self.tur_head == world) // aparenly this can happpen before TNSF_SETUP. great.
+            self.tur_head = spawn();
+            
         self.tur_head.move_avelocity_x = ReadShort();
         self.tur_head.move_avelocity_y = ReadShort();            
     }
@@ -643,7 +649,7 @@ void ent_turret()
     if(sf & TNSF_STATUS)
     {
         float _tmp;
-        _tmp = ReadByte();        
+        _tmp = ReadByte();
         if(_tmp != self.team)
         {            
             self.team = _tmp;