]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/server/tturrets/units/unit_checkpoint.qc
Fix MLRS and Hellion (animations and logic)
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / tturrets / units / unit_checkpoint.qc
1 /**
2     turret_checkpoint
3 **/
4
5
6 //.entity checkpoint_target;
7
8 /*
9 #define checkpoint_cache_who  flagcarried
10 #define checkpoint_cache_from lastrocket
11 #define checkpoint_cache_to   selected_player
12 */
13
14 .entity pathgoal;
15 .entity pathcurrent;
16
17 /*
18 entity path_makeorcache(entity forwho,entity start, entity end)
19 {
20     entity oldself;
21     entity pth;
22     oldself = self;
23     self = forwho;
24
25     //pth = pathlib_makepath(start.origin,end.origin,PFL_GROUNDSNAP,500,1.5,PT_QUICKSTAR);
26
27     self = oldself;
28     return pth;
29 }
30 */
31
32 void turret_checkpoint_use()
33 {
34 }
35
36 /*QUAKED turret_checkpoint (1 0 1) (-32 -32 -32) (32 32 32)
37 -----------KEYS------------
38 target: .targetname of next waypoint in chain.
39 wait:   Pause at this point # seconds.
40 -----------SPAWNFLAGS-----------
41 ---------NOTES----------
42 If a loop is of targets are formed, any unit entering this loop will patrol it indefinitly.
43 If the checkpoint chain in not looped, the unit will go "Roaming" when the last point is reached.
44 */
45 void turret_checkpoint_init()
46 {
47     traceline(self.origin, self.origin - '0 0 1024', MOVE_WORLDONLY, self);
48     setorigin(self,trace_endpos + '0 0 8');
49
50     if(self.target != "")
51     {
52         self.enemy = find(world,targetname,self.target);
53         if(self.enemy == world)
54             dprint("A turret_checkpoint faild to find its target!\n");
55     }
56 }
57
58 void spawnfunc_turret_checkpoint()
59 {
60     setorigin(self,self.origin);
61     self.think = turret_checkpoint_init;
62     self.nextthink = time + 0.1;
63 }
64
65 // Compat.
66 void spawnfunc_walker_checkpoint()
67 {
68     self.classname = "turret_checkpoint";
69     spawnfunc_turret_checkpoint();
70 }