X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fcommon%2Fturrets%2Fcheckpoint.qc;h=46526df4d615db53dc99f2391b2abc07d24f7805;hb=17308b9ad60c2f773be0de39b811a9752e3037af;hp=f2fc3a8cb134a285a54dfc65cc9806b9748a7f1c;hpb=919c48e2ad5873bf1efb041be2e23e2e60903baf;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/common/turrets/checkpoint.qc b/qcsrc/common/turrets/checkpoint.qc index f2fc3a8cb..46526df4d 100644 --- a/qcsrc/common/turrets/checkpoint.qc +++ b/qcsrc/common/turrets/checkpoint.qc @@ -16,14 +16,10 @@ /* entity path_makeorcache(entity forwho,entity start, entity end) { - entity oldself; entity pth; - oldself = self; - self = forwho; - //pth = pathlib_makepath(start.origin,end.origin,PFL_GROUNDSNAP,500,1.5,PT_QUICKSTAR); + //pth = pathlib_makepath(forwho, start.origin,end.origin,PFL_GROUNDSNAP,500,1.5,PT_QUICKSTAR); - self = oldself; return pth; } */ @@ -33,12 +29,12 @@ void turret_checkpoint_use() } #if 0 -void turret_checkpoint_think() +void turret_checkpoint_think(entity this) { - if(self.enemy) - te_lightning1(self,self.origin, self.enemy.origin); + if(this.enemy) + te_lightning1(this,this.origin, this.enemy.origin); - self.nextthink = time + 0.25; + this.nextthink = time + 0.25; } #endif /*QUAKED turret_checkpoint (1 0 1) (-32 -32 -32) (32 32 32) @@ -51,32 +47,32 @@ If a loop is of targets are formed, any unit entering this loop will patrol it i If the checkpoint chain in not looped, the unit will go "Roaming" when the last point is reached. */ //float tc_acum; -void turret_checkpoint_init() +void turret_checkpoint_init(entity this) { - traceline(self.origin + '0 0 16', self.origin - '0 0 1024', MOVE_WORLDONLY, self); - setorigin(self, trace_endpos + '0 0 32'); + traceline(this.origin + '0 0 16', this.origin - '0 0 1024', MOVE_WORLDONLY, this); + setorigin(this, trace_endpos + '0 0 32'); - if(self.target != "") + if(this.target != "") { - self.enemy = find(world, targetname, self.target); - if(self.enemy == world) - dprint("A turret_checkpoint faild to find its target!\n"); + this.enemy = find(world, targetname, this.target); + if(this.enemy == world) + LOG_TRACE("A turret_checkpoint faild to find its target!\n"); } - //self.think = turret_checkpoint_think; - //self.nextthink = time + tc_acum + 0.25; + //setthink(this, turret_checkpoint_think); + //this.nextthink = time + tc_acum + 0.25; //tc_acum += 0.25; } -void spawnfunc_turret_checkpoint() +spawnfunc(turret_checkpoint) { - setorigin(self,self.origin); - self.think = turret_checkpoint_init; - self.nextthink = time + 0.2; + setorigin(this,this.origin); + setthink(this, turret_checkpoint_init); + this.nextthink = time + 0.2; } // Compat. -void spawnfunc_walker_checkpoint() +spawnfunc(walker_checkpoint) { - self.classname = "turret_checkpoint"; - spawnfunc_turret_checkpoint(); + this.classname = "turret_checkpoint"; + spawnfunc_turret_checkpoint(this); }