From: TimePath Date: Sun, 1 Nov 2015 11:09:58 +0000 (+1100) Subject: Racer: remove some uses of self X-Git-Tag: xonotic-v0.8.2~1744 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=0c3b2b9b523ec6ee43603c6fcfa623c7e556c5b0;p=xonotic%2Fxonotic-data.pk3dir.git Racer: remove some uses of self --- diff --git a/qcsrc/common/vehicles/vehicle/racer.qc b/qcsrc/common/vehicles/vehicle/racer.qc index 1f573cda3..c92bfadd6 100644 --- a/qcsrc/common/vehicles/vehicle/racer.qc +++ b/qcsrc/common/vehicles/vehicle/racer.qc @@ -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; diff --git a/qcsrc/common/vehicles/vehicle/racer_weapon.qc b/qcsrc/common/vehicles/vehicle/racer_weapon.qc index 6672713ad..50c09d132 100644 --- a/qcsrc/common/vehicles/vehicle/racer_weapon.qc +++ b/qcsrc/common/vehicles/vehicle/racer_weapon.qc @@ -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;