Fix MLRS and Hellion (animations and logic)
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / tturrets / units / unit_mlrs.qc
index e28b9b4aaed33a73a0a7963c37713798862fe52d..499d6de2352c15c55d591d762cca0d40eb1f32f1 100644 (file)
@@ -6,9 +6,14 @@ void turret_mlrs_rocket_touch();
 
 void turret_mlrs_postthink()
 {
-
     // 0 = full, 6 = empty
-    self.tur_head.frame = rint(6 - (self.ammo / self.shot_dmg));
+    self.tur_head.frame = bound(0, 6 - floor(0.1 + self.ammo / self.shot_dmg), 6);
+    if(self.tur_head.frame < 0)
+    {
+       dprint("ammo:",ftos(self.ammo),"\n");
+       dprint("shot_dmg:",ftos(self.shot_dmg),"\n");
+    }
+    
 }
 
 void turret_mlrs_attack()
@@ -106,7 +111,7 @@ void turret_mlrs_dinit()
     self.shoot_flags  |= TFL_SHOOT_VOLLYALWAYS;
     self.volly_counter = self.shot_volly;
 
-    if (!turret_tag_setup())
+    if (!turret_tag_fire_update())
         dprint("Warning: Turret ",self.classname, " faild to initialize md3 tags\n");
 
     // Our fire routine