]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/turrets/unit/ewheel.qc
Merge branch 'master' into TimePath/effectinfo
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / turrets / unit / ewheel.qc
index 495e60ff39086ae19fed62647496bff2a9bd14b1..cd111b258e6851a2d2b5450dd6ed396b7b7d98c8 100644 (file)
@@ -1,4 +1,4 @@
-#ifdef REGISTER_TURRET
+#ifndef IMPLEMENTATION
 REGISTER_TURRET(
 /* TUR_##id   */ EWHEEL,
 /* function   */ t_ewheel,
@@ -25,7 +25,7 @@ const float ewheel_anim_bck_fast = 4;
 
 //#define EWHEEL_FANCYPATH
 void ewheel_move_path()
-{
+{SELFPARAM();
 #ifdef EWHEEL_FANCYPATH
     // Are we close enougth to a path node to switch to the next?
     if (vlen(self.origin  - self.pathcurrent.origin) < 64)
@@ -68,7 +68,7 @@ void ewheel_move_path()
 }
 
 void ewheel_move_enemy()
-{
+{SELFPARAM();
     float newframe;
 
     self.steerto = steerlib_arrive(self.enemy.origin,self.target_range_optimal);
@@ -109,7 +109,7 @@ void ewheel_move_enemy()
 }
 
 void ewheel_move_idle()
-{
+{SELFPARAM();
     if(self.frame != 0)
     {
         self.SendFlags |= TNSF_ANIM;
@@ -121,10 +121,10 @@ void ewheel_move_idle()
         movelib_beak_simple((autocvar_g_turrets_unit_ewheel_speed_stop));
 }
 
-void spawnfunc_turret_ewheel() { if(!turret_initialize(TUR_EWHEEL)) remove(self); }
+void spawnfunc_turret_ewheel() { SELFPARAM(); if(!turret_initialize(TUR_EWHEEL.m_id)) remove(self); }
 
 float t_ewheel(float req)
-{
+{SELFPARAM();
     switch(req)
     {
         case TR_ATTACK:
@@ -136,10 +136,10 @@ float t_ewheel(float req)
             {
                 turret_do_updates(self);
 
-                _mis = turret_projectile("weapons/lasergun_fire.wav", 1, 0, DEATH_TURRET_EWHEEL, PROJECTILE_BLASTER, TRUE, TRUE);
+                _mis = turret_projectile(SND(LASERGUN_FIRE), 1, 0, DEATH_TURRET_EWHEEL, PROJECTILE_BLASTER, TRUE, TRUE);
                 _mis.missile_flags = MIF_SPLASH;
 
-                Send_Effect("laser_muzzleflash", self.tur_shotorg, self.tur_shotdir_updated * 1000, 1);
+                Send_Effect(EFFECT_BLASTER_MUZZLEFLASH, self.tur_shotorg, self.tur_shotdir_updated * 1000, 1);
 
                 self.tur_head.frame += 2;
 
@@ -212,12 +212,12 @@ float t_ewheel(float req)
                     e = find(world, targetname, self.target);
                     if (!e)
                     {
-                        dprint("Initital waypoint for ewheel does NOT exsist, fix your map!\n");
+                        LOG_TRACE("Initital waypoint for ewheel does NOT exsist, fix your map!\n");
                         self.target = "";
                     }
 
                     if (e.classname != "turret_checkpoint")
-                        dprint("Warning: not a turrret path\n");
+                        LOG_TRACE("Warning: not a turrret path\n");
                     else
                     {
 
@@ -252,8 +252,6 @@ float t_ewheel(float req)
         }
         case TR_PRECACHE:
         {
-            precache_model ("models/turrets/ewheel-base2.md3");
-            precache_model ("models/turrets/ewheel-gun1.md3");
             return true;
         }
     }
@@ -265,7 +263,7 @@ float t_ewheel(float req)
 #ifdef CSQC
 
 void ewheel_draw()
-{
+{SELFPARAM();
     float dt;
 
     dt = time - self.move_time;
@@ -284,7 +282,7 @@ void ewheel_draw()
 }
 
 float t_ewheel(float req)
-{
+{SELFPARAM();
     switch(req)
     {
         case TR_SETUP: