X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fcommon%2Fturrets%2Fcheckpoint.qc;h=25c61b4b67b19c1192a7752b23a77f8cd7945581;hb=879c8320d2938040d7b3f0ff879532fd82e9739d;hp=2b0bd6f6763b338b8a3144f960c54348e7310b29;hpb=c89dfaa4d0342b98c320621557973a65114fbdf4;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/common/turrets/checkpoint.qc b/qcsrc/common/turrets/checkpoint.qc index 2b0bd6f67..25c61b4b6 100644 --- a/qcsrc/common/turrets/checkpoint.qc +++ b/qcsrc/common/turrets/checkpoint.qc @@ -1,46 +1,7 @@ -/** - turret_checkpoint -**/ +#include "checkpoint.qh" +#ifdef SVQC -//.entity checkpoint_target; - -/* -#define checkpoint_cache_who flagcarried -#define checkpoint_cache_from lastrocket -#define checkpoint_cache_to selected_player -*/ - -.entity pathgoal; - -/* -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); - - self = oldself; - return pth; -} -*/ - -void turret_checkpoint_use() -{ -} - -#if 0 -void turret_checkpoint_think() -{SELFPARAM(); - if(self.enemy) - te_lightning1(self,self.origin, self.enemy.origin); - - self.nextthink = time + 0.25; -} -#endif /*QUAKED turret_checkpoint (1 0 1) (-32 -32 -32) (32 32 32) -----------KEYS------------ target: .targetname of next waypoint in chain. @@ -48,35 +9,32 @@ wait: Pause at this point # seconds. -----------SPAWNFLAGS----------- ---------NOTES---------- If a loop is of targets are formed, any unit entering this loop will patrol it indefinitly. -If the checkpoint chain in not looped, the unit will go "Roaming" when the last point is reached. +If the checkpoint chain is not looped, the unit will go "Roaming" when the last point is reached. */ -//float tc_acum; -void turret_checkpoint_init() -{SELFPARAM(); - traceline(self.origin + '0 0 16', self.origin - '0 0 1024', MOVE_WORLDONLY, self); - setorigin(self, trace_endpos + '0 0 32'); +void turret_checkpoint_init(entity this) +{ + 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 && this.target != "") { - self.enemy = find(world, targetname, self.target); - if(self.enemy == world) - LOG_TRACE("A turret_checkpoint faild to find its target!\n"); + this.enemy = find(NULL, targetname, this.target); + if(!this.enemy) + LOG_TRACE("A turret_checkpoint failed to find its target!"); } - //self.think = turret_checkpoint_think; - //self.nextthink = time + tc_acum + 0.25; - //tc_acum += 0.25; } -void spawnfunc_turret_checkpoint() -{SELFPARAM(); - setorigin(self,self.origin); - self.think = turret_checkpoint_init; - self.nextthink = time + 0.2; +spawnfunc(turret_checkpoint) +{ + setorigin(this, this.origin); + InitializeEntity(this, turret_checkpoint_init, INITPRIO_FINDTARGET); } // Compat. -void spawnfunc_walker_checkpoint() -{SELFPARAM(); - self.classname = "turret_checkpoint"; - spawnfunc_turret_checkpoint(); +spawnfunc(walker_checkpoint) +{ + this.classname = "turret_checkpoint"; + spawnfunc_turret_checkpoint(this); } + +#endif