X-Git-Url: https://git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fcommon%2Fturrets%2Fturret%2Fhk_weapon.qc;h=ddad35d025e68e973f0b0520dc09a70a9cd17f94;hb=26693a3ac060825ce6c7f170d4e65f7ac2a1fb25;hp=5a4677dcec19cb97c8cb48e1ef8e582111a73aa8;hpb=df2fe9b28cb6210b671bec6d5ae834ff4eb2e2db;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/common/turrets/turret/hk_weapon.qc b/qcsrc/common/turrets/turret/hk_weapon.qc index 5a4677dce..ddad35d02 100644 --- a/qcsrc/common/turrets/turret/hk_weapon.qc +++ b/qcsrc/common/turrets/turret/hk_weapon.qc @@ -20,7 +20,7 @@ METHOD(HunterKillerAttack, wr_think, void(entity thiswep, entity actor, .entity if (!isPlayer || weapon_prepareattack(thiswep, actor, weaponentity, false, WEP_CVAR_PRI(electro, refire))) { if (isPlayer) { turret_initparams(actor); - W_SetupShot_Dir(actor, v_forward, false, 0, SND_HunterKillerAttack_FIRE, CH_WEAPON_B, 0); + W_SetupShot_Dir(actor, weaponentity, v_forward, false, 0, SND_HunterKillerAttack_FIRE, CH_WEAPON_B, 0); actor.tur_shotdir_updated = w_shotdir; actor.tur_shotorg = w_shotorg; actor.tur_head = actor; @@ -31,7 +31,7 @@ METHOD(HunterKillerAttack, wr_think, void(entity thiswep, entity actor, .entity setthink(missile, turret_hk_missile_think); missile.nextthink = time + 0.25; - missile.movetype = MOVETYPE_BOUNCEMISSILE; + set_movetype(missile, MOVETYPE_BOUNCEMISSILE); missile.velocity = actor.tur_shotdir_updated * (actor.shot_speed * 0.75); missile.angles = vectoangles(missile.velocity); missile.cnt = time + 30; @@ -64,7 +64,7 @@ void turret_hk_missile_think(entity this) // turret_hk_missile_explode(); if (IS_DEAD(this.enemy)) - this.enemy = world; + this.enemy = NULL; // Pick the closest valid target. if (!this.enemy) @@ -116,7 +116,7 @@ void turret_hk_missile_think(entity this) fe = 0; } - if ((fe != 1) || (this.enemy == world) || (edist > 1000)) + if ((fe != 1) || (this.enemy == NULL) || (edist > 1000)) { myspeed = vlen(this.velocity); @@ -207,7 +207,7 @@ void turret_hk_missile_think(entity this) { this.cnt = time + 0.25; this.nextthink = 0; - this.movetype = MOVETYPE_BOUNCE; + set_movetype(this, MOVETYPE_BOUNCE); return; } @@ -226,15 +226,15 @@ void turret_hk_missile_think(entity this) //if(this.atime < time) { if ((fe <= 0.99)||(edist > 1000)) { - te_lightning2(world,this.origin, this.origin + vr * lt_seek); - te_lightning2(world,this.origin, this.origin + vl * lt_seek); - te_lightning2(world,this.origin, this.origin + vu * lt_seek); - te_lightning2(world,this.origin, this.origin + vd * lt_seek); - te_lightning2(world,this.origin, vf); + te_lightning2(NULL,this.origin, this.origin + vr * lt_seek); + te_lightning2(NULL,this.origin, this.origin + vl * lt_seek); + te_lightning2(NULL,this.origin, this.origin + vu * lt_seek); + te_lightning2(NULL,this.origin, this.origin + vd * lt_seek); + te_lightning2(NULL,this.origin, vf); } else { - te_lightning2(world,this.origin, this.enemy.origin); + te_lightning2(NULL,this.origin, this.enemy.origin); } bprint("Speed: ", ftos(rint(myspeed)), "\n"); bprint("Trace to solid: ", ftos(rint(ff * 100)), "%\n"); @@ -248,7 +248,7 @@ void turret_hk_missile_think(entity this) bool hk_is_valid_target(entity this, entity e_target) { - if (e_target == world) + if (e_target == NULL) return false; // If only this was used more..