]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Fix http://dev.xonotic.org/issues/944 Likely things may be strange anyway if TNSF_SET...
authorJakob MG <jakob_mg@hotmail.com>
Sat, 31 Dec 2011 08:56:10 +0000 (09:56 +0100)
committerJakob MG <jakob_mg@hotmail.com>
Sat, 31 Dec 2011 08:56:10 +0000 (09:56 +0100)
qcsrc/client/tturrets.qc

index 89f1be7fa826d008d2cf2795408a3385ee37e375..2b9ec0297b2ef63411d210cc8a8597bc8438691f 100644 (file)
@@ -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;