]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/tturrets/units/unit_machinegun.qc
Merge remote-tracking branch 'origin/divVerent/allow-override-item-model'
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / tturrets / units / unit_machinegun.qc
index 4777722da86223327ccf145b01219422817e6ab1..f96d3b93cc79911ba5e7036da81f49a92858f6ec 100644 (file)
@@ -5,26 +5,11 @@ void turret_machinegun_attack();
 //.float bulletcounter;
 void turret_machinegun_attack()
 {
-
-    entity flash;
-
-    sound (self, CHAN_WEAPON, "weapons/uzi_fire.wav", VOL_BASE, ATTN_NORM);
-    fireBallisticBullet (self.tur_shotorg, self.tur_shotdir_updated,self.shot_spread, self.shot_speed, 5, self.shot_dmg, 0, self.shot_force, DEATH_TURRET, 0, 1, cvar("g_balance_uzi_bulletconstant"));
+    fireBallisticBullet (self.tur_shotorg, self.tur_shotdir_updated,self.shot_spread, self.shot_speed, 5, self.shot_dmg, 0, self.shot_force, DEATH_TURRET_MACHINEGUN, 0, 1, autocvar_g_balance_uzi_bulletconstant);
     endFireBallisticBullet();
 
-    //w_deathtypestring = "had an alergic reaction due to 10 kilos of led";
-    te_smallflash(self.tur_shotorg);
-
-    // muzzle flash for 3rd person view
-    flash = spawn();
-    setmodel(flash, "models/uziflash.md3"); // precision set below
-    setattachment(flash, self.tur_head, "tag_fire");
-    flash.think = W_Uzi_Flash_Go;
-    flash.nextthink = time + 0.02;
-    flash.frame = 2;
-    flash.angles_z = flash.v_angle_z + random() * 180;
-    flash.alpha = 1;
-    flash.effects = EF_ADDITIVE | EF_FULLBRIGHT | EF_LOWPRECISION;
+    UziFlash();
+    setattachment(self.muzzle_flash, self.tur_head, "tag_fire");
 }
 
 
@@ -36,10 +21,10 @@ void turret_machinegun_std_init()
     self.turrcaps_flags = TFL_TURRCAPS_PLAYERKILL;
     self.aim_flags = TFL_AIM_LEAD | TFL_AIM_SHOTTIMECOMPENSATE;
     
-       if not (cvar("g_antilag_bullets"))
+       if not (autocvar_g_antilag_bullets)
                self.turrcaps_flags |= TFL_TURRCAPS_HITSCAN;
 
-    if (turret_stdproc_init("machinegun_std",0,"models/turrets/base.md3","models/turrets/machinegun.md3") == 0)
+    if (turret_stdproc_init("machinegun_std", "models/turrets/base.md3", "models/turrets/machinegun.md3", TID_MACHINEGUN) == 0)
     {
         remove(self);
         return;
@@ -47,9 +32,6 @@ void turret_machinegun_std_init()
 
     self.damage_flags |= TFL_DMG_HEADSHAKE;
 
-    if (!turret_tag_fire_update())
-        dprint("Warning: Turret ",self.classname, " faild to initialize md3 tags\n");
-
     // Our fire routine
     self.turret_firefunc  = turret_machinegun_attack;