]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Racer: remove some uses of self
authorTimePath <andrew.hardaker1995@gmail.com>
Sun, 1 Nov 2015 11:09:58 +0000 (22:09 +1100)
committerTimePath <andrew.hardaker1995@gmail.com>
Sun, 1 Nov 2015 11:09:58 +0000 (22:09 +1100)
qcsrc/common/vehicles/vehicle/racer.qc
qcsrc/common/vehicles/vehicle/racer_weapon.qc

index 1f573cda378240b6c70001825c4d9ecd8b602f40..c92bfadd6c29157ab3746f9c327e8a4983c34c99 100644 (file)
@@ -153,11 +153,11 @@ void racer_align4point(float _delta)
        self.angles_z *= 1 - (autocvar_g_vehicle_racer_anglestabilizer * _delta);
 }
 
-void racer_fire_rocket_aim(string tagname, entity trg)
+void racer_fire_rocket_aim(entity player, string tagname, entity trg)
 {
-       SELFPARAM();
-       vector v = gettaginfo(self, gettagindex(self, tagname));
-       racer_fire_rocket(v, v_forward, trg);
+       entity racer = player.vehicle;
+       vector v = gettaginfo(racer, gettagindex(racer, tagname));
+       racer_fire_rocket(player, v, v_forward, trg);
 }
 
 float racer_frame()
@@ -350,12 +350,12 @@ float racer_frame()
 
                if(racer.misc_bulletcounter == 1)
                {
-                       racer_fire_rocket_aim("tag_rocket_r", (racer.lock_strength == 1 && racer.lock_target) ? racer.lock_target : world);
+                       racer_fire_rocket_aim(player, "tag_rocket_r", (racer.lock_strength == 1 && racer.lock_target) ? racer.lock_target : world);
                        player.vehicle_ammo2 = 50;
                }
                else if(racer.misc_bulletcounter == 2)
                {
-                       racer_fire_rocket_aim("tag_rocket_l", (racer.lock_strength == 1 && racer.lock_target) ? racer.lock_target : world);
+                       racer_fire_rocket_aim(player, "tag_rocket_l", (racer.lock_strength == 1 && racer.lock_target) ? racer.lock_target : world);
                        racer.lock_strength  = 0;
                        racer.lock_target       = world;
                        racer.misc_bulletcounter = 0;
index 6672713adab361f747a39121643e86c67e0865ea..50c09d132f74294dd6002675bc36edf05da4d712 100644 (file)
@@ -14,7 +14,7 @@ REGISTER_WEAPON(RACER, NEW(RacerAttack));
 // TODO: move into implementation
 #ifdef SVQC
 float autocvar_g_vehicle_racer_rocket_refire;
-void racer_fire_rocket(vector org, vector dir, entity trg);
+void racer_fire_rocket(entity player, vector org, vector dir, entity trg);
 #endif
 
 #endif
@@ -41,7 +41,7 @@ float autocvar_g_vehicle_racer_rocket_turnrate;
 float autocvar_g_vehicle_racer_rocket_climbspeed;
 float autocvar_g_vehicle_racer_rocket_locked_maxangle;
 
-void racer_fire_rocket(vector org, vector dir, entity trg);
+void racer_fire_rocket(entity player, vector org, vector dir, entity trg);
 METHOD(RacerAttack, wr_think, void(entity thiswep, entity actor, int slot, int fire))
 {
     bool isPlayer = IS_PLAYER(actor);
@@ -66,7 +66,7 @@ METHOD(RacerAttack, wr_think, void(entity thiswep, entity actor, int slot, int f
     if (fire & 2)
     if (!isPlayer || weapon_prepareattack(thiswep, actor, slot, false, 0.2)) {
         if (isPlayer) W_SetupShot_Dir(actor, v_forward, false, 0, SND(Null), CH_WEAPON_B, 0);
-        racer_fire_rocket(w_shotorg, w_shotdir, NULL);
+        racer_fire_rocket(player, w_shotorg, w_shotdir, NULL);
         weapon_thinkf(actor, slot, WFRAME_FIRE2, 0, w_ready);
     }
 }
@@ -83,12 +83,12 @@ METHOD(RacerAttack, wr_checkammo1, bool(RacerAttack thiswep))
 void racer_rocket_tracker();
 void racer_rocket_groundhugger();
 
-void racer_fire_rocket(vector org, vector dir, entity trg)
+void racer_fire_rocket(entity player, vector org, vector dir, entity trg)
 {SELFPARAM();
     entity rocket = vehicles_projectile(EFFECT_RACER_ROCKETLAUNCH.eent_eff_name, SND(ROCKET_FIRE),
                            org, dir * autocvar_g_vehicle_racer_rocket_speed,
                            autocvar_g_vehicle_racer_rocket_damage, autocvar_g_vehicle_racer_rocket_radius, autocvar_g_vehicle_racer_rocket_force, 3,
-                           DEATH_VH_WAKI_ROCKET.m_id, PROJECTILE_WAKIROCKET, 20, false, false, self.owner);
+                           DEATH_VH_WAKI_ROCKET.m_id, PROJECTILE_WAKIROCKET, 20, false, false, player);
 
     rocket.lip                   = autocvar_g_vehicle_racer_rocket_accel * sys_frametime;
     rocket.wait                         = autocvar_g_vehicle_racer_rocket_turnrate;