X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;ds=sidebyside;f=qcsrc%2Fcommon%2Fturrets%2Fturret%2Fhellion_weapon.qc;h=f053d782e3b7ea481faa4362d00853aada221c99;hb=d82eed5c84b40a8eb68d9bca12e40506c6c7b6d9;hp=7df79c8c7e03d41f1c1fc214047b51b8abac9674;hpb=37cf62041a76248472ef6a78feaaed33e35a2260;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/common/turrets/turret/hellion_weapon.qc b/qcsrc/common/turrets/turret/hellion_weapon.qc index 7df79c8c7..f053d782e 100644 --- a/qcsrc/common/turrets/turret/hellion_weapon.qc +++ b/qcsrc/common/turrets/turret/hellion_weapon.qc @@ -7,7 +7,7 @@ float autocvar_g_turrets_unit_hellion_shot_speed_gain; float autocvar_g_turrets_unit_hellion_shot_speed_max; -void turret_hellion_missile_think(); +void turret_hellion_missile_think(entity this); SOUND(HellionAttack_FIRE, W_Sound("electro_fire")); METHOD(HellionAttack, wr_think, void(entity thiswep, entity actor, .entity weaponentity, int fire)) { bool isPlayer = IS_PLAYER(actor); @@ -29,9 +29,9 @@ METHOD(HellionAttack, wr_think, void(entity thiswep, entity actor, .entity weapo actor.tur_shotorg = gettaginfo(actor.tur_head, gettagindex(actor.tur_head, "tag_fire2")); } - entity missile = turret_projectile(SND_ROCKET_FIRE, 6, 10, DEATH_TURRET_HELLION.m_id, PROJECTILE_ROCKET, false, false); + entity missile = turret_projectile(actor, SND_ROCKET_FIRE, 6, 10, DEATH_TURRET_HELLION.m_id, PROJECTILE_ROCKET, false, false); te_explosion (missile.origin); - missile.think = turret_hellion_missile_think; + setthink(missile, turret_hellion_missile_think); missile.nextthink = time; missile.flags = FL_PROJECTILE; missile.max_health = time + 9; @@ -41,8 +41,8 @@ METHOD(HellionAttack, wr_think, void(entity thiswep, entity actor, .entity weapo } } -void turret_hellion_missile_think() -{SELFPARAM(); +void turret_hellion_missile_think(entity this) +{ vector olddir,newdir; vector pre_pos; float itime; @@ -52,7 +52,7 @@ void turret_hellion_missile_think() olddir = normalize(self.velocity); if(self.max_health < time) - turret_projectile_explode(); + turret_projectile_explode(self); // Enemy dead? just keep on the current heading then. if ((self.enemy == world) || (IS_DEAD(self.enemy))) @@ -65,7 +65,7 @@ void turret_hellion_missile_think() self.angles = vectoangles(self.velocity); if(vdist(self.origin - self.owner.origin, >, (self.owner.shot_radius * 5))) - turret_projectile_explode(); + turret_projectile_explode(self); // Accelerate self.velocity = olddir * min(vlen(self.velocity) * (autocvar_g_turrets_unit_hellion_shot_speed_gain), (autocvar_g_turrets_unit_hellion_shot_speed_max)); @@ -77,7 +77,7 @@ void turret_hellion_missile_think() // Enemy in range? if(vdist(self.origin - self.enemy.origin, <, self.owner.shot_radius * 0.2)) - turret_projectile_explode(); + turret_projectile_explode(self); // Predict enemy position itime = vlen(self.enemy.origin - self.origin) / vlen(self.velocity); @@ -98,7 +98,7 @@ void turret_hellion_missile_think() self.velocity = newdir * min(vlen(self.velocity) * (autocvar_g_turrets_unit_hellion_shot_speed_gain), (autocvar_g_turrets_unit_hellion_shot_speed_max)); if (itime < 0.05) - self.think = turret_projectile_explode; + setthink(self, turret_projectile_explode); UpdateCSQCProjectile(self); }