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()
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;
// 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
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);
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);
}
}
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;