X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fcommon%2Fturrets%2Fturret%2Ffusionreactor.qc;h=013c089f3cf4a4a606988d19d7202e5748e1eb5d;hb=d82eed5c84b40a8eb68d9bca12e40506c6c7b6d9;hp=9b67e1db2fd714cbd0b4e972ce2380bd921d37c6;hpb=9d865b9e241eafebe0b458e52464fc4c51693351;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/common/turrets/turret/fusionreactor.qc b/qcsrc/common/turrets/turret/fusionreactor.qc index 9b67e1db2..013c089f3 100644 --- a/qcsrc/common/turrets/turret/fusionreactor.qc +++ b/qcsrc/common/turrets/turret/fusionreactor.qc @@ -17,36 +17,36 @@ REGISTER_TURRET(FUSIONREACTOR, NEW(FusionReactor)); #ifdef IMPLEMENTATION #ifdef SVQC -bool turret_fusionreactor_firecheck() -{SELFPARAM(); - if (self.attack_finished_single[0] > time) +bool turret_fusionreactor_firecheck(entity this) +{ + if (this.attack_finished_single[0] > time) return false; - if (IS_DEAD(self.enemy)) + if (IS_DEAD(this.enemy)) return false; - if (self.enemy == world) + if (this.enemy == world) return false; - if (self.ammo < self.shot_dmg) + if (this.ammo < this.shot_dmg) return false; - if (self.enemy.ammo >= self.enemy.ammo_max) + if (this.enemy.ammo >= this.enemy.ammo_max) return false; - if(vdist(self.enemy.origin - self.origin, >, self.target_range)) + if(vdist(this.enemy.origin - this.origin, >, this.target_range)) return false; - if(self.team != self.enemy.team) + if(this.team != this.enemy.team) return false; - if(!(self.enemy.ammo_flags & TFL_AMMO_ENERGY)) + if(!(this.enemy.ammo_flags & TFL_AMMO_ENERGY)) return false; return true; } -spawnfunc(turret_fusionreactor) { if (!turret_initialize(TUR_FUSIONREACTOR)) remove(this); } +spawnfunc(turret_fusionreactor) { if (!turret_initialize(this, TUR_FUSIONREACTOR)) remove(this); } METHOD(FusionReactor, tr_attack, void(FusionReactor this, entity it)) { @@ -56,8 +56,7 @@ METHOD(FusionReactor, tr_attack, void(FusionReactor this, entity it)) } METHOD(FusionReactor, tr_think, void(FusionReactor thistur, entity it)) { - SELFPARAM(); - self.tur_head.avelocity = '0 250 0' * (self.ammo / self.ammo_max); + it.tur_head.avelocity = '0 250 0' * (it.ammo / it.ammo_max); } METHOD(FusionReactor, tr_setup, void(FusionReactor this, entity it)) {