5 void() trigger_push_touch =
7 local float flighttime, dist, grav;
15 // figure out how long it will take to hit the point considering gravity
16 grav = cvar("sv_gravity");
17 flighttime = sqrt((self.enemy.origin_z - org_z) / (0.5 * grav));
21 // how far in X and Y to move
22 self.movedir = (self.enemy.origin - org);
24 dist = vlen(self.movedir);
26 // finally calculate the velocity
27 self.movedir = normalize(self.movedir) * (dist / flighttime);
28 self.movedir_z = flighttime * grav;
30 other.velocity = self.movedir;
31 other.flags = other.flags - (other.flags & FL_ONGROUND);
33 if (self.spawnflags & PUSH_ONCE)
35 self.touch = SUB_Null;
36 self.think = SUB_Remove;
37 self.nextthink = time;
41 void() trigger_push_findtarget =
44 self.enemy = find(world, targetname, self.target);
46 objerror("trigger_push: target not found\n");
51 if (self.angles != '0 0 0')
54 self.solid = SOLID_TRIGGER;
55 setmodel (self, self.model);
56 self.movetype = MOVETYPE_NONE;
60 self.touch = trigger_push_touch;
62 // check if this is a jump pad
65 self.think = trigger_push_findtarget;
66 self.nextthink = time + 0.2;
73 self.movedir = self.movedir * self.speed * 10;
77 void() target_push = { trigger_push(); };
78 void() info_notnull = {};
79 void() target_position = {};