7 float sv_airaccelerate;
\r
8 float sv_maxairspeed;
\r
11 float sv_airaccel_sideways_friction;
\r
12 float sv_airaccel_qw;
\r
13 float sv_airstopaccelerate;
\r
14 float sv_airstrafeaccelerate;
\r
15 float sv_maxairstrafespeed;
\r
16 float sv_aircontrol;
\r
17 float sv_warsowbunny_airforwardaccel;
\r
18 float sv_warsowbunny_accel;
\r
19 float sv_warsowbunny_topspeed;
\r
20 float sv_warsowbunny_turnaccel;
\r
21 float sv_warsowbunny_backtosideratio;
\r
24 .entity ladder_entity;
\r
26 .float swamp_slowdown;
\r
30 .float spectatorspeed;
\r
32 .float multijump_count;
\r
33 .float multijump_ready;
\r
34 .float prevjumpbutton;
\r
35 .float prevlastteleporttime;
\r
41 When you press the jump key
\r
44 void PlayerJump (void)
\r
50 if (cvar("sv_doublejump"))
\r
52 tracebox(self.origin + '0 0 0.01', self.mins, self.maxs, self.origin - '0 0 0.01', MOVE_NORMAL, self);
\r
53 if (trace_fraction < 1 && trace_plane_normal_z > 0.7)
\r
57 mjumpheight = cvar("sv_jumpvelocity");
\r
58 if(cvar("g_healthsize")) // if we are smaller or larger, we jump lower or higher
\r
59 mjumpheight *= (1 - cvar("g_healthsize_movementfactor")) + cvar("g_healthsize_movementfactor") * self.scale;
\r
60 if(self.swallow_progress_prey) // cut jumping based on swallow progress for prey
\r
61 mjumpheight *= 1 - (self.swallow_progress_prey * cvar("g_balance_vore_swallow_speed_cutspd_prey"));
\r
62 if(self.swallow_progress_pred) // cut jumping based on swallow progress for preds
\r
63 mjumpheight *= 1 - (self.swallow_progress_pred * cvar("g_balance_vore_swallow_speed_cutspd_pred"));
\r
65 if (self.waterlevel >= WATERLEVEL_SWIMMING)
\r
67 if (self.watertype == CONTENT_WATER)
\r
68 self.velocity_z = 200;
\r
69 else if (self.watertype == CONTENT_SLIME)
\r
70 self.velocity_z = 80;
\r
72 self.velocity_z = 50;
\r
77 if (cvar("g_multijump"))
\r
79 if(self.prevlastteleporttime != self.lastteleporttime)
\r
81 // if we teleported above the ground, require touching the ground again to multi-jump
\r
82 self.multijump_ready = FALSE;
\r
83 if(self.flags & FL_ONGROUND)
\r
84 self.prevlastteleporttime = self.lastteleporttime;
\r
86 else if (self.prevjumpbutton == FALSE && !(self.flags & FL_ONGROUND)) // jump button pressed this frame and we are in midair
\r
87 self.multijump_ready = TRUE; // this is necessary to check that we released the jump button and pressed it again
\r
89 self.multijump_ready = FALSE;
\r
92 if(!doublejump && self.multijump_ready && self.multijump_count < cvar("g_multijump") && self.velocity_z > cvar("g_multijump_speed"))
\r
94 // doublejump = FALSE; // checked above in the if
\r
95 if (cvar("g_multijump"))
\r
97 if (cvar("g_multijump_add") == 0) // in this case we make the z velocity == jumpvelocity
\r
99 if (self.velocity_z < mjumpheight)
\r
102 self.velocity_z = 0;
\r
110 if(self.movement_x != 0 || self.movement_y != 0) // don't remove all speed if player isnt pressing any movement keys
\r
113 vector wishvel, wishdir;
\r
116 vlen(vec2(self.velocity)), // current xy speed
\r
117 vlen(vec2(antilag_takebackavgvelocity(self, max(self.lastteleporttime + sys_frametime, time - 0.25), time))) // average xy topspeed over the last 0.25 secs
\r
119 makevectors(self.v_angle_y * '0 1 0');
\r
120 wishvel = v_forward * self.movement_x + v_right * self.movement_y;
\r
121 wishdir = normalize(wishvel);
\r
123 self.velocity_x = wishdir_x * curspeed; // allow "dodging" at a multijump
\r
124 self.velocity_y = wishdir_y * curspeed;
\r
125 // keep velocity_z unchanged!
\r
127 if (cvar("g_multijump") > 0)
\r
128 self.multijump_count += 1;
\r
131 self.multijump_ready = FALSE; // require releasing and pressing the jump button again for the next jump
\r
135 if (!(self.flags & FL_ONGROUND))
\r
139 if (!(self.flags & FL_JUMPRELEASED))
\r
142 if(self.health <= g_bloodloss)
\r
145 if(cvar_string("sv_jumpspeedcap_min") != "")
\r
146 self.velocity_z = max(cvar("sv_jumpvelocity") * cvar("sv_jumpspeedcap_min"), self.velocity_z);
\r
147 if(cvar_string("sv_jumpspeedcap_max") != "") {
\r
148 if(trace_fraction < 1 && trace_plane_normal_z < 0.98 && cvar("sv_jumpspeedcap_max_disable_on_ramps")) {
\r
149 // don't do jump speedcaps on ramps to preserve old voretournament ramjump style
\r
150 //print("Trace plane normal z: ", ftos(trace_plane_normal_z), ", disabling speed cap!\n");
\r
153 self.velocity_z = min(cvar("sv_jumpvelocity") * cvar("sv_jumpspeedcap_max"), self.velocity_z) + trace_ent.velocity_z;
\r
156 if(!(self.lastflags & FL_ONGROUND))
\r
158 if(cvar("speedmeter"))
\r
159 dprint(strcat("landing velocity: ", vtos(self.velocity), " (abs: ", ftos(vlen(self.velocity)), ")\n"));
\r
160 if(self.lastground < time - 0.3)
\r
162 self.velocity_x *= (1 - cvar("sv_friction_on_land"));
\r
163 self.velocity_y *= (1 - cvar("sv_friction_on_land"));
\r
165 if(self.jumppadcount > 1)
\r
166 dprint(strcat(ftos(self.jumppadcount), "x jumppad combo\n"));
\r
167 self.jumppadcount = 0;
\r
170 self.velocity_z = self.velocity_z + mjumpheight;
\r
171 self.oldvelocity_z = self.velocity_z;
\r
173 self.flags &~= FL_ONGROUND;
\r
174 self.flags &~= FL_JUMPRELEASED;
\r
177 setanim(self, self.anim_duckjump, FALSE, TRUE, TRUE);
\r
179 setanim(self, self.anim_jump, FALSE, TRUE, TRUE);
\r
182 PlayerSound(self, playersound_jump, CHAN_PLAYER, VOICETYPE_PLAYERSOUND);
\r
184 self.restart_jump = -1; // restart jump anim next time
\r
185 // value -1 is used to not use the teleport bit (workaround for tiny hitch when re-jumping)
\r
188 void CheckWaterJump()
\r
190 local vector start, end;
\r
192 // check for a jump-out-of-water
\r
193 makevectors (self.angles);
\r
194 start = self.origin;
\r
195 start_z = start_z + 8;
\r
197 normalize(v_forward);
\r
198 end = start + v_forward*24;
\r
199 traceline (start, end, TRUE, self);
\r
200 if (trace_fraction < 1)
\r
201 { // solid at waist
\r
202 start_z = start_z + self.maxs_z - 8;
\r
203 end = start + v_forward*24;
\r
204 self.movedir = trace_plane_normal * -50;
\r
205 traceline (start, end, TRUE, self);
\r
206 if (trace_fraction == 1)
\r
207 { // open at eye level
\r
208 self.flags |= FL_WATERJUMP;
\r
209 self.velocity_z = 225;
\r
210 self.flags &~= FL_JUMPRELEASED;
\r
211 self.teleport_time = time + 2; // safety net
\r
217 float racecar_angle(float forward, float down)
\r
219 float ret, angle_mult;
\r
223 forward = -forward;
\r
227 ret = vectoyaw('0 1 0' * down + '1 0 0' * forward);
\r
229 angle_mult = forward / (800 + forward);
\r
232 return ret * angle_mult + 360 * (1 - angle_mult);
\r
234 return ret * angle_mult;
\r
237 void RaceCarPhysics()
\r
239 // using this move type for "big rigs"
\r
240 // the engine does not push the entity!
\r
242 float accel, steer, f;
\r
243 vector angles_save, rigvel;
\r
245 angles_save = self.angles;
\r
246 accel = bound(-1, self.movement_x / sv_maxspeed, 1);
\r
247 steer = bound(-1, self.movement_y / sv_maxspeed, 1);
\r
249 if(g_bugrigs_reverse_speeding)
\r
253 // back accel is DIGITAL
\r
254 // to prevent speedhack
\r
264 makevectors(self.angles); // new forward direction!
\r
266 if(self.flags & FL_ONGROUND || g_bugrigs_air_steering)
\r
268 float myspeed, upspeed, steerfactor, accelfactor;
\r
270 myspeed = self.velocity * v_forward;
\r
271 upspeed = self.velocity * v_up;
\r
273 // responsiveness factor for steering and acceleration
\r
274 f = 1 / (1 + pow(max(-myspeed, myspeed) / g_bugrigs_speed_ref, g_bugrigs_speed_pow));
\r
275 //MAXIMA: f(v) := 1 / (1 + (v / g_bugrigs_speed_ref) ^ g_bugrigs_speed_pow);
\r
277 if(myspeed < 0 && g_bugrigs_reverse_spinning)
\r
278 steerfactor = -myspeed * g_bugrigs_steer;
\r
280 steerfactor = -myspeed * f * g_bugrigs_steer;
\r
282 if(myspeed < 0 && g_bugrigs_reverse_speeding)
\r
283 accelfactor = g_bugrigs_accel;
\r
285 accelfactor = f * g_bugrigs_accel;
\r
286 //MAXIMA: accel(v) := f(v) * g_bugrigs_accel;
\r
292 myspeed = max(0, myspeed - frametime * (g_bugrigs_friction_floor - g_bugrigs_friction_brake * accel));
\r
296 if(!g_bugrigs_reverse_speeding)
\r
297 myspeed = min(0, myspeed + frametime * g_bugrigs_friction_floor);
\r
304 myspeed = max(0, myspeed - frametime * g_bugrigs_friction_floor);
\r
308 if(g_bugrigs_reverse_stopping)
\r
311 myspeed = min(0, myspeed + frametime * (g_bugrigs_friction_floor + g_bugrigs_friction_brake * accel));
\r
314 // terminal velocity = velocity at which 50 == accelfactor, that is, 1549 units/sec
\r
315 //MAXIMA: friction(v) := g_bugrigs_friction_floor;
\r
317 self.angles_y += steer * frametime * steerfactor; // apply steering
\r
318 makevectors(self.angles); // new forward direction!
\r
320 myspeed += accel * accelfactor * frametime;
\r
322 rigvel = myspeed * v_forward + '0 0 1' * upspeed;
\r
326 myspeed = vlen(self.velocity);
\r
328 // responsiveness factor for steering and acceleration
\r
329 f = 1 / (1 + pow(max(0, myspeed / g_bugrigs_speed_ref), g_bugrigs_speed_pow));
\r
330 steerfactor = -myspeed * f;
\r
331 self.angles_y += steer * frametime * steerfactor; // apply steering
\r
333 rigvel = self.velocity;
\r
334 makevectors(self.angles); // new forward direction!
\r
337 rigvel = rigvel * max(0, 1 - vlen(rigvel) * g_bugrigs_friction_air * frametime);
\r
338 //MAXIMA: airfriction(v) := v * v * g_bugrigs_friction_air;
\r
339 //MAXIMA: total_acceleration(v) := accel(v) - friction(v) - airfriction(v);
\r
340 //MAXIMA: solve(total_acceleration(v) = 0, v);
\r
342 if(g_bugrigs_planar_movement)
\r
344 vector rigvel_xy, neworigin, up;
\r
347 rigvel_z -= frametime * sv_gravity; // 4x gravity plays better
\r
348 rigvel_xy = rigvel;
\r
351 if(g_bugrigs_planar_movement_car_jumping && !g_touchexplode) // touchexplode is a better way to handle collisions
\r
354 mt = MOVE_NOMONSTERS;
\r
356 tracebox(self.origin, self.mins, self.maxs, self.origin + '0 0 1024', mt, self);
\r
357 up = trace_endpos - self.origin;
\r
359 // BUG RIGS: align the move to the surface instead of doing collision testing
\r
361 tracebox(trace_endpos, self.mins, self.maxs, trace_endpos + rigvel_xy * frametime, mt, self);
\r
363 // align to surface
\r
364 tracebox(trace_endpos, self.mins, self.maxs, trace_endpos - up + '0 0 1' * rigvel_z * frametime, mt, self);
\r
366 if(trace_fraction < 0.5)
\r
368 trace_fraction = 1;
\r
369 neworigin = self.origin;
\r
372 neworigin = trace_endpos;
\r
374 if(trace_fraction < 1)
\r
376 // now set angles_x so that the car points parallel to the surface
\r
377 self.angles = vectoangles(
\r
378 '1 0 0' * v_forward_x * trace_plane_normal_z
\r
380 '0 1 0' * v_forward_y * trace_plane_normal_z
\r
382 '0 0 1' * -(v_forward_x * trace_plane_normal_x + v_forward_y * trace_plane_normal_y)
\r
384 self.flags |= FL_ONGROUND;
\r
388 // now set angles_x so that the car points forward, but is tilted in velocity direction
\r
389 self.flags &~= FL_ONGROUND;
\r
392 self.velocity = (neworigin - self.origin) * (1.0 / frametime);
\r
393 self.movetype = MOVETYPE_NOCLIP;
\r
397 rigvel_z -= frametime * sv_gravity; // 4x gravity plays better
\r
398 self.velocity = rigvel;
\r
399 self.movetype = MOVETYPE_FLY;
\r
402 trace_fraction = 1;
\r
403 tracebox(self.origin, self.mins, self.maxs, self.origin - '0 0 4', MOVE_NORMAL, self);
\r
404 if(trace_fraction != 1)
\r
406 self.angles = vectoangles2(
\r
407 '1 0 0' * v_forward_x * trace_plane_normal_z
\r
409 '0 1 0' * v_forward_y * trace_plane_normal_z
\r
411 '0 0 1' * -(v_forward_x * trace_plane_normal_x + v_forward_y * trace_plane_normal_y),
\r
419 vel_local_x = v_forward * self.velocity;
\r
420 vel_local_y = v_right * self.velocity;
\r
421 vel_local_z = v_up * self.velocity;
\r
423 self.angles_x = racecar_angle(vel_local_x, vel_local_z);
\r
424 self.angles_z = racecar_angle(-vel_local_y, vel_local_z);
\r
427 // smooth the angles
\r
428 vector vf1, vu1, smoothangles;
\r
429 makevectors(self.angles);
\r
430 f = bound(0, frametime * g_bugrigs_angle_smoothing, 1);
\r
433 vf1 = v_forward * f;
\r
435 makevectors(angles_save);
\r
436 vf1 = vf1 + v_forward * (1 - f);
\r
437 vu1 = vu1 + v_up * (1 - f);
\r
438 smoothangles = vectoangles2(vf1, vu1);
\r
439 self.angles_x = -smoothangles_x;
\r
440 self.angles_z = smoothangles_z;
\r
443 float IsMoveInDirection(vector mv, float angle) // key mix factor
\r
445 if(mv_x == 0 && mv_y == 0)
\r
446 return 0; // avoid division by zero
\r
447 angle = RAD2DEG * atan2(mv_y, mv_x);
\r
448 angle = remainder(angle, 360) / 45;
\r
453 return 1 - fabs(angle);
\r
456 void CPM_PM_Aircontrol(vector wishdir, float wishspeed)
\r
458 float zspeed, xyspeed, dot, k;
\r
461 // this doesn't play well with analog input
\r
462 if(self.movement_x == 0 || self.movement_y != 0)
\r
463 return; // can't control movement if not moving forward or backward
\r
466 k = 32 * (2 * IsMoveInDirection(self.movement, 0) - 1);
\r
471 k *= bound(0, wishspeed / sv_maxairspeed, 1);
\r
473 zspeed = self.velocity_z;
\r
474 self.velocity_z = 0;
\r
475 xyspeed = vlen(self.velocity); self.velocity = normalize(self.velocity);
\r
477 dot = self.velocity * wishdir;
\r
478 k *= sv_aircontrol*dot*dot*frametime;
\r
480 if(dot > 0) // we can't change direction while slowing down
\r
482 self.velocity = normalize(self.velocity * xyspeed + wishdir * k);
\r
485 self.velocity = self.velocity * xyspeed;
\r
486 self.velocity_z = zspeed;
\r
489 // example config for alternate speed clamping:
\r
490 // sv_airaccel_qw 0.8
\r
491 // sv_airaccel_sideways_friction 0
\r
492 // prvm_globalset server speedclamp_mode 1
\r
494 void PM_Accelerate(vector wishdir, float wishspeed, float wishspeed0, float accel, float accelqw, float sidefric)
\r
496 float vel_straight;
\r
498 vector vel_perpend;
\r
502 float vel_xy_current;
\r
503 float vel_xy_backward, vel_xy_forward;
\r
506 speedclamp = (accelqw < 0);
\r
508 accelqw = -accelqw;
\r
510 if(self.classname == "player")
\r
512 if(cvar("g_balance_vore_load_pred_weight") > 0) // apply stomach weight
\r
513 wishspeed /= 1 + (self.stomach_load / self.stomach_maxload) * cvar("g_balance_vore_load_pred_speed");
\r
514 if(cvar("g_healthsize")) // if we are smaller or larger, we run slower or faster
\r
515 wishspeed *= (1 - cvar("g_healthsize_movementfactor")) + cvar("g_healthsize_movementfactor") * self.scale;
\r
516 if(self.swallow_progress_prey) // cut speed based on swallow progress for prey
\r
517 wishspeed *= 1 - (self.swallow_progress_prey * cvar("g_balance_vore_swallow_speed_cutspd_prey"));
\r
518 if(self.swallow_progress_pred) // cut speed based on swallow progress for preds
\r
519 wishspeed *= 1 - (self.swallow_progress_pred * cvar("g_balance_vore_swallow_speed_cutspd_pred"));
\r
520 if(self.grabber_stunned > time && random() <= cvar("g_balance_grabber_secondary_stun_rate")) // randomly cut speed while the player is stunned
\r
524 if(cvar("sv_gameplayfix_q2airaccelerate"))
\r
525 wishspeed0 = wishspeed;
\r
527 vel_straight = self.velocity * wishdir;
\r
528 vel_z = self.velocity_z;
\r
529 vel_xy = self.velocity - vel_z * '0 0 1';
\r
530 vel_perpend = vel_xy - vel_straight * wishdir;
\r
532 step = accel * frametime * wishspeed0;
\r
534 vel_xy_current = vlen(vel_xy);
\r
535 vel_xy_forward = vel_xy_current + bound(0, wishspeed - vel_xy_current, step) * accelqw + step * (1 - accelqw);
\r
536 vel_xy_backward = vel_xy_current - bound(0, wishspeed + vel_xy_current, step) * accelqw - step * (1 - accelqw);
\r
537 if(vel_xy_backward < 0)
\r
538 vel_xy_backward = 0; // not that it REALLY occurs that this would cause wrong behaviour afterwards
\r
540 vel_straight = vel_straight + bound(0, wishspeed - vel_straight, step) * accelqw + step * (1 - accelqw);
\r
542 if(sidefric < 0 && (vel_perpend*vel_perpend))
\r
543 // negative: only apply so much sideways friction to stay below the speed you could get by "braking"
\r
546 f = max(0, 1 + frametime * wishspeed * sidefric);
\r
547 fminimum = (vel_xy_backward*vel_xy_backward - vel_straight*vel_straight) / (vel_perpend*vel_perpend);
\r
548 // this cannot be > 1
\r
550 vel_perpend = vel_perpend * max(0, f);
\r
553 fminimum = sqrt(fminimum);
\r
554 vel_perpend = vel_perpend * max(fminimum, f);
\r
558 vel_perpend = vel_perpend * max(0, 1 - frametime * wishspeed * sidefric);
\r
560 vel_xy = vel_straight * wishdir + vel_perpend;
\r
564 // ensure we don't get too fast or decelerate faster than we should
\r
565 vel_xy_current = min(vlen(vel_xy), vel_xy_forward);
\r
566 if(vel_xy_current > 0) // prevent division by zero
\r
567 vel_xy = normalize(vel_xy) * vel_xy_current;
\r
570 self.velocity = vel_xy + vel_z * '0 0 1';
\r
573 void PM_AirAccelerate(vector wishdir, float wishspeed)
\r
575 vector curvel, wishvel, acceldir, curdir;
\r
576 float addspeed, accelspeed, curspeed, f;
\r
582 curvel = self.velocity;
\r
584 curspeed = vlen(curvel);
\r
586 if(wishspeed > curspeed * 1.01)
\r
588 wishspeed = min(wishspeed, curspeed + sv_warsowbunny_airforwardaccel * sv_maxspeed * frametime);
\r
592 f = max(0, (sv_warsowbunny_topspeed - curspeed) / (sv_warsowbunny_topspeed - sv_maxspeed));
\r
593 wishspeed = max(curspeed, sv_maxspeed) + sv_warsowbunny_accel * f * sv_maxspeed * frametime;
\r
595 wishvel = wishdir * wishspeed;
\r
596 acceldir = wishvel - curvel;
\r
597 addspeed = vlen(acceldir);
\r
598 acceldir = normalize(acceldir);
\r
600 accelspeed = min(addspeed, sv_warsowbunny_turnaccel * sv_maxspeed * frametime);
\r
602 if(sv_warsowbunny_backtosideratio < 1)
\r
604 curdir = normalize(curvel);
\r
605 dot = acceldir * curdir;
\r
607 acceldir = acceldir - (1 - sv_warsowbunny_backtosideratio) * dot * curdir;
\r
610 self.velocity += accelspeed * acceldir;
\r
613 .vector movement_old;
\r
614 .float buttons_old;
\r
615 .vector v_angle_old;
\r
616 .string lastclassname;
\r
618 .float() PlayerPhysplug;
\r
620 string specialcommand = "xwxwxsxsxaxdxaxdx1x ";
\r
621 .float specialcommand_pos;
\r
622 void SpecialCommand()
\r
627 if(!CheatImpulse(99))
\r
628 print("A hollow voice says \"Plugh\".\n");
\r
632 float speedaward_speed;
\r
633 string speedaward_holder;
\r
634 void race_send_speedaward(float msg)
\r
636 // send the best speed of the round
\r
637 WriteByte(msg, SVC_TEMPENTITY);
\r
638 WriteByte(msg, TE_CSQC_RACE);
\r
639 WriteByte(msg, RACE_NET_SPEED_AWARD);
\r
640 WriteInt24_t(msg, floor(speedaward_speed+0.5));
\r
641 WriteString(msg, speedaward_holder);
\r
644 float speedaward_alltimebest;
\r
645 string speedaward_alltimebest_holder;
\r
646 void race_send_speedaward_alltimebest(float msg)
\r
648 // send the best speed
\r
649 WriteByte(msg, SVC_TEMPENTITY);
\r
650 WriteByte(msg, TE_CSQC_RACE);
\r
651 WriteByte(msg, RACE_NET_SPEED_AWARD_BEST);
\r
652 WriteInt24_t(msg, floor(speedaward_alltimebest+0.5));
\r
653 WriteString(msg, speedaward_alltimebest_holder);
\r
656 string GetMapname(void);
\r
657 float speedaward_lastupdate;
\r
658 float speedaward_lastsent;
\r
659 .float jumppadusetime;
\r
660 void SV_PlayerPhysics()
\r
662 local vector wishvel, wishdir, v;
\r
663 local float wishspeed, f, maxspd_mod, spd, maxairspd, airaccel, swampspd_mod, buttons;
\r
665 float buttons_prev;
\r
666 float not_allowed_to_move;
\r
669 if(self.PlayerPhysplug)
\r
670 if(self.PlayerPhysplug())
\r
673 self.race_movetime_frac += frametime;
\r
674 f = floor(self.race_movetime_frac);
\r
675 self.race_movetime_frac -= f;
\r
676 self.race_movetime_count += f;
\r
677 self.race_movetime = self.race_movetime_frac + self.race_movetime_count;
\r
679 anticheat_physics();
\r
681 buttons = self.BUTTON_ATCK + 2 * self.BUTTON_JUMP + 4 * self.BUTTON_ATCK2 + 8 * self.BUTTON_ZOOM + 16 * self.BUTTON_CROUCH + 32 * self.BUTTON_JETPACK + 64 * self.BUTTON_USE + 128 * (self.movement_x < 0) + 256 * (self.movement_x > 0) + 512 * (self.movement_y < 0) + 1024 * (self.movement_y > 0);
\r
685 else if(buttons == 1)
\r
687 else if(buttons == 2)
\r
689 else if(buttons == 128)
\r
691 else if(buttons == 256)
\r
693 else if(buttons == 512)
\r
695 else if(buttons == 1024)
\r
700 if(c == substring(specialcommand, self.specialcommand_pos, 1))
\r
702 self.specialcommand_pos += 1;
\r
703 if(self.specialcommand_pos >= strlen(specialcommand))
\r
705 self.specialcommand_pos = 0;
\r
710 else if(self.specialcommand_pos && (c != substring(specialcommand, self.specialcommand_pos - 1, 1)))
\r
711 self.specialcommand_pos = 0;
\r
713 if(!sv_maxidle_spectatorsareidle || self.movetype == MOVETYPE_WALK)
\r
715 if(buttons != self.buttons_old || self.movement != self.movement_old || self.v_angle != self.v_angle_old)
\r
716 self.parm_idlesince = time;
\r
718 buttons_prev = self.buttons_old;
\r
719 self.buttons_old = buttons;
\r
720 self.movement_old = self.movement;
\r
721 self.v_angle_old = self.v_angle;
\r
723 if(time < self.nickspamtime)
\r
724 if(self.nickspamcount >= cvar("g_nick_flood_penalty_yellow"))
\r
726 // slight annoyance for nick change scripts
\r
727 self.movement = -1 * self.movement;
\r
728 self.BUTTON_ATCK = self.BUTTON_JUMP = self.BUTTON_ATCK2 = self.BUTTON_ZOOM = self.BUTTON_CROUCH = self.BUTTON_JETPACK = self.BUTTON_USE = 0;
\r
730 if(self.nickspamcount >= cvar("g_nick_flood_penalty_red")) // if you are persistent and the slight annoyance above does not stop you, I'll show you!
\r
732 self.angles_x = random() * 360;
\r
733 self.angles_y = random() * 360;
\r
734 // at least I'm not forcing retardedview by also assigning to angles_z
\r
739 if (self.punchangle != '0 0 0')
\r
741 f = vlen(self.punchangle) - cvar("sv_punchangle_speed") * frametime;
\r
743 self.punchangle = normalize(self.punchangle) * f;
\r
745 self.punchangle = '0 0 0';
\r
748 if (self.punchvector != '0 0 0')
\r
750 f = vlen(self.punchvector) - cvar("sv_punchvector_speed") * frametime;
\r
752 self.punchvector = normalize(self.punchvector) * f;
\r
754 self.punchvector = '0 0 0';
\r
757 if (clienttype(self) == CLIENTTYPE_BOT)
\r
759 if(playerdemo_read())
\r
764 self.items &~= IT_USING_JETPACK;
\r
766 if(self.classname == "player")
\r
768 if(self.race_penalty)
\r
769 if(time > self.race_penalty)
\r
770 self.race_penalty = 0;
\r
772 not_allowed_to_move = 0;
\r
773 if(self.race_penalty)
\r
774 not_allowed_to_move = 1;
\r
775 if(!cvar("sv_ready_restart_after_countdown"))
\r
776 if(time < game_starttime)
\r
777 not_allowed_to_move = 1;
\r
779 if(not_allowed_to_move)
\r
781 self.velocity = '0 0 0';
\r
782 self.movetype = MOVETYPE_NONE;
\r
783 self.disableclientprediction = 2;
\r
785 else if(self.disableclientprediction == 2)
\r
787 if(self.movetype == MOVETYPE_NONE)
\r
788 self.movetype = MOVETYPE_WALK;
\r
789 self.disableclientprediction = 0;
\r
793 if(self.stat_eaten)
\r
796 if (self.movetype == MOVETYPE_NONE)
\r
802 if(self.in_swamp) {
\r
803 swampspd_mod = self.swamp_slowdown; //cvar("g_balance_swamp_moverate");
\r
806 if(self.classname != "player")
\r
808 maxspd_mod = cvar("sv_spectator_speed_multiplier");
\r
809 if(!self.spectatorspeed)
\r
810 self.spectatorspeed = maxspd_mod;
\r
811 if(self.impulse && self.impulse <= 19)
\r
813 if(self.lastclassname != "player")
\r
815 if(self.impulse == 10 || self.impulse == 15 || self.impulse == 18)
\r
816 self.spectatorspeed = bound(1, self.spectatorspeed + 0.5, 5);
\r
817 else if(self.impulse == 11)
\r
818 self.spectatorspeed = maxspd_mod;
\r
819 else if(self.impulse == 12 || self.impulse == 16 || self.impulse == 19)
\r
820 self.spectatorspeed = bound(1, self.spectatorspeed - 0.5, 5);
\r
821 else if(self.impulse >= 1 && self.impulse <= 9)
\r
822 self.spectatorspeed = 1 + 0.5 * (self.impulse - 1);
\r
823 } // otherwise just clear
\r
826 maxspd_mod = self.spectatorspeed;
\r
829 spd = max(sv_maxspeed, sv_maxairspeed) * maxspd_mod * swampspd_mod;
\r
830 if(self.speed != spd)
\r
834 stuffcmd(self, strcat("cl_forwardspeed ", temps, "\n"));
\r
835 stuffcmd(self, strcat("cl_backspeed ", temps, "\n"));
\r
836 stuffcmd(self, strcat("cl_sidespeed ", temps, "\n"));
\r
837 stuffcmd(self, strcat("cl_upspeed ", temps, "\n"));
\r
840 maxspd_mod *= swampspd_mod; // only one common speed modder please!
\r
843 // if dead, behave differently
\r
847 if (!self.fixangle && !g_bugrigs)
\r
850 self.angles_y = self.v_angle_y;
\r
854 if(self.flags & FL_ONGROUND)
\r
857 self.wasFlying = 0;
\r
859 if(self.classname == "player")
\r
860 if(self.waterlevel < WATERLEVEL_SWIMMING)
\r
861 if(time >= self.ladder_time)
\r
862 if not(self.grabber)
\r
864 self.nextstep = time + 0.3 + random() * 0.1;
\r
865 trace_dphitq3surfaceflags = 0;
\r
866 tracebox(self.origin, self.mins, self.maxs, self.origin - '0 0 1', MOVE_NOMONSTERS, self);
\r
867 if not(trace_dphitq3surfaceflags & Q3SURFACEFLAG_NOSTEPS)
\r
869 if(cvar("g_healthsize"))
\r
871 if(trace_dphitq3surfaceflags & Q3SURFACEFLAG_METALSTEPS)
\r
873 GlobalSound(globalsound_metalfall, CHAN_PLAYER, VOICETYPE_PLAYERSOUND, bound(0, VOL_BASE * (1 - playersize_micro(self)), 1));
\r
874 pointparticles(particleeffectnum("ground_metal"), self.origin, '0 0 0', self.scale);
\r
878 GlobalSound(globalsound_fall, CHAN_PLAYER, VOICETYPE_PLAYERSOUND, bound(0, VOL_BASE * (1 - playersize_micro(self)), 1));
\r
879 pointparticles(particleeffectnum("ground_dirt"), self.origin, '0 0 0', self.scale);
\r
881 sound(self, CHAN_AUTO, "misc/macro_hitground.wav", bound(0, VOL_BASE * playersize_macro(self), 1), ATTN_NORM);
\r
883 // earthquake effect for nearby players when a macro falls
\r
884 if(cvar("g_healthsize_quake_fall"))
\r
887 for(head = findradius(self.origin, cvar("g_healthsize_quake_fall_radius")); head; head = head.chain)
\r
889 if not(head.classname == "player" || head.classname == "spectator")
\r
891 if(head == self || head.spectatee_status == num_for_edict(self))
\r
892 continue; // not for self
\r
893 if not(head.flags & FL_ONGROUND)
\r
894 continue; // we only feel the ground shaking if we are sitting on it
\r
895 if(head.stat_eaten)
\r
896 continue; // not for prey
\r
899 shake = vlen(head.origin - self.origin);
\r
901 shake = 1 - bound(0, shake / cvar("g_healthsize_quake_fall_radius"), 1);
\r
902 shake *= playersize_macro(self) * cvar("g_healthsize_quake_fall");
\r
904 head.punchvector_x += crandom() * shake;
\r
905 head.punchvector_y += crandom() * shake;
\r
906 head.punchvector_z += crandom() * shake;
\r
912 if(trace_dphitq3surfaceflags & Q3SURFACEFLAG_METALSTEPS)
\r
914 GlobalSound(globalsound_metalfall, CHAN_PLAYER, VOICETYPE_PLAYERSOUND, VOL_BASE);
\r
915 pointparticles(particleeffectnum("ground_metal"), self.origin, '0 0 0', 1);
\r
919 GlobalSound(globalsound_fall, CHAN_PLAYER, VOICETYPE_PLAYERSOUND, VOL_BASE);
\r
920 pointparticles(particleeffectnum("ground_dirt"), self.origin, '0 0 0', 1);
\r
928 self.wasFlying = 1;
\r
930 if(self.classname == "player")
\r
932 if(self.flags & FL_ONGROUND)
\r
934 if (cvar("g_multijump") > 0)
\r
935 self.multijump_count = 0;
\r
937 self.multijump_count = -2; // the cvar value for infinite jumps is -1, so this needs to be smaller
\r
940 if (self.BUTTON_JUMP)
\r
943 self.flags |= FL_JUMPRELEASED;
\r
945 if (self.waterlevel == WATERLEVEL_SWIMMING)
\r
947 self.prevjumpbutton = self.BUTTON_JUMP;
\r
950 if (self.flags & FL_WATERJUMP )
\r
952 self.velocity_x = self.movedir_x;
\r
953 self.velocity_y = self.movedir_y;
\r
954 if (time > self.teleport_time || self.waterlevel == WATERLEVEL_NONE)
\r
956 self.flags &~= FL_WATERJUMP;
\r
957 self.teleport_time = 0;
\r
960 else if (g_bugrigs && self.classname == "player")
\r
964 else if (self.movetype == MOVETYPE_NOCLIP || self.movetype == MOVETYPE_FLY || self.movetype == MOVETYPE_FLY_WORLDONLY)
\r
966 // noclipping or flying
\r
967 self.flags &~= FL_ONGROUND;
\r
969 self.velocity = self.velocity * (1 - frametime * sv_friction);
\r
970 makevectors(self.v_angle);
\r
971 //wishvel = v_forward * self.movement_x + v_right * self.movement_y + v_up * self.movement_z;
\r
972 wishvel = v_forward * self.movement_x + v_right * self.movement_y + '0 0 1' * self.movement_z;
\r
974 wishdir = normalize(wishvel);
\r
975 wishspeed = vlen(wishvel);
\r
976 if (wishspeed > sv_maxspeed*maxspd_mod)
\r
977 wishspeed = sv_maxspeed*maxspd_mod;
\r
978 if (time >= self.teleport_time)
\r
979 PM_Accelerate(wishdir, wishspeed, wishspeed, sv_accelerate*maxspd_mod, 1, 0);
\r
981 else if (self.waterlevel >= WATERLEVEL_SWIMMING)
\r
984 self.flags &~= FL_ONGROUND;
\r
986 makevectors(self.v_angle);
\r
987 //wishvel = v_forward * self.movement_x + v_right * self.movement_y + v_up * self.movement_z;
\r
988 wishvel = v_forward * self.movement_x + v_right * self.movement_y + '0 0 1' * self.movement_z;
\r
989 if (wishvel == '0 0 0')
\r
990 wishvel = '0 0 -60'; // drift towards bottom
\r
992 wishdir = normalize(wishvel);
\r
993 wishspeed = vlen(wishvel);
\r
994 if (wishspeed > sv_maxspeed*maxspd_mod)
\r
995 wishspeed = sv_maxspeed*maxspd_mod;
\r
996 wishspeed = wishspeed * 0.7;
\r
999 self.velocity = self.velocity * (1 - frametime * sv_friction);
\r
1001 // water acceleration
\r
1002 PM_Accelerate(wishdir, wishspeed, wishspeed, sv_accelerate*maxspd_mod, 1, 0);
\r
1004 else if (time < self.ladder_time)
\r
1006 // on a spawnfunc_func_ladder or swimming in spawnfunc_func_water
\r
1007 self.flags &~= FL_ONGROUND;
\r
1009 self.velocity = self.velocity * (1 - frametime * sv_friction);
\r
1010 makevectors(self.v_angle);
\r
1011 //wishvel = v_forward * self.movement_x + v_right * self.movement_y + v_up * self.movement_z;
\r
1012 wishvel = v_forward * self.movement_x + v_right * self.movement_y + '0 0 1' * self.movement_z;
\r
1014 self.velocity_z = self.velocity_z + self.gravity * sv_gravity * frametime;
\r
1016 self.velocity_z = self.velocity_z + sv_gravity * frametime;
\r
1017 if (self.ladder_entity.classname == "func_water")
\r
1019 f = vlen(wishvel);
\r
1020 if (f > self.ladder_entity.speed)
\r
1021 wishvel = wishvel * (self.ladder_entity.speed / f);
\r
1023 self.watertype = self.ladder_entity.skin;
\r
1024 f = self.ladder_entity.origin_z + self.ladder_entity.maxs_z;
\r
1025 if ((self.origin_z + self.view_ofs_z) < f)
\r
1026 self.waterlevel = WATERLEVEL_SUBMERGED;
\r
1027 else if ((self.origin_z + (self.mins_z + self.maxs_z) * 0.5) < f)
\r
1028 self.waterlevel = WATERLEVEL_SWIMMING;
\r
1029 else if ((self.origin_z + self.mins_z + 1) < f)
\r
1030 self.waterlevel = WATERLEVEL_WETFEET;
\r
1033 self.waterlevel = WATERLEVEL_NONE;
\r
1034 self.watertype = CONTENT_EMPTY;
\r
1038 wishdir = normalize(wishvel);
\r
1039 wishspeed = vlen(wishvel);
\r
1040 if (wishspeed > sv_maxspeed*maxspd_mod)
\r
1041 wishspeed = sv_maxspeed*maxspd_mod;
\r
1042 if (time >= self.teleport_time)
\r
1044 // water acceleration
\r
1045 PM_Accelerate(wishdir, wishspeed, wishspeed, sv_accelerate*maxspd_mod, 1, 0);
\r
1048 else if ((self.items & IT_JETPACK) && self.BUTTON_JETPACK && (!cvar("g_jetpack_fuel") || self.ammo_fuel >= 0.01 || self.items & IT_UNLIMITED_WEAPON_AMMO) && !self.stat_eaten)
\r
1050 //makevectors(self.v_angle_y * '0 1 0');
\r
1051 makevectors(self.v_angle);
\r
1052 wishvel = v_forward * self.movement_x + v_right * self.movement_y;
\r
1053 // add remaining speed as Z component
\r
1054 maxairspd = sv_maxairspeed*max(1, maxspd_mod);
\r
1055 // fix speedhacks :P
\r
1056 wishvel = normalize(wishvel) * min(vlen(wishvel) / maxairspd, 1);
\r
1057 // add the unused velocity as up component
\r
1060 // if(self.BUTTON_JUMP)
\r
1061 wishvel_z = sqrt(max(0, 1 - wishvel * wishvel));
\r
1063 // it is now normalized, so...
\r
1064 float a_side, a_up, a_add, a_diff;
\r
1065 a_side = cvar("g_jetpack_acceleration_side");
\r
1066 a_up = cvar("g_jetpack_acceleration_up");
\r
1067 a_add = cvar("g_jetpack_antigravity") * sv_gravity;
\r
1069 wishvel_x *= a_side;
\r
1070 wishvel_y *= a_side;
\r
1071 wishvel_z *= a_up;
\r
1072 wishvel_z += a_add;
\r
1076 //////////////////////////////////////////////////////////////////////////////////////
\r
1077 // finding the maximum over all vectors of above form
\r
1078 // with wishvel having an absolute value of 1
\r
1079 //////////////////////////////////////////////////////////////////////////////////////
\r
1080 // we're finding the maximum over
\r
1081 // f(a_side, a_up, a_add, z) := a_side * (1 - z^2) + (a_add + a_up * z)^2;
\r
1082 // for z in the range from -1 to 1
\r
1083 //////////////////////////////////////////////////////////////////////////////////////
\r
1084 // maximum is EITHER attained at the single extreme point:
\r
1085 a_diff = a_side * a_side - a_up * a_up;
\r
1088 f = a_add * a_up / a_diff; // this is the zero of diff(f(a_side, a_up, a_add, z), z)
\r
1089 if(f > -1 && f < 1) // can it be attained?
\r
1091 best = (a_diff + a_add * a_add) * (a_diff + a_up * a_up) / a_diff;
\r
1092 //print("middle\n");
\r
1095 // OR attained at z = 1:
\r
1096 f = (a_up + a_add) * (a_up + a_add);
\r
1102 // OR attained at z = -1:
\r
1103 f = (a_up - a_add) * (a_up - a_add);
\r
1107 //print("bottom\n");
\r
1109 best = sqrt(best);
\r
1110 //////////////////////////////////////////////////////////////////////////////////////
\r
1112 //print("best possible acceleration: ", ftos(best), "\n");
\r
1115 fxy = bound(0, 1 - (self.velocity * normalize(wishvel_x * '1 0 0' + wishvel_y * '0 1 0')) / cvar("g_jetpack_maxspeed_side"), 1);
\r
1116 if(wishvel_z - sv_gravity > 0)
\r
1117 fz = bound(0, 1 - self.velocity_z / cvar("g_jetpack_maxspeed_up"), 1);
\r
1119 fz = bound(0, 1 + self.velocity_z / cvar("g_jetpack_maxspeed_up"), 1);
\r
1122 fvel = vlen(wishvel);
\r
1125 wishvel_z = (wishvel_z - sv_gravity) * fz + sv_gravity;
\r
1127 fvel = min(1, vlen(wishvel) / best);
\r
1128 if(cvar("g_jetpack_fuel") && !(self.items & IT_UNLIMITED_WEAPON_AMMO))
\r
1129 f = min(1, self.ammo_fuel / (cvar("g_jetpack_fuel") * frametime * fvel));
\r
1133 //print("this acceleration: ", ftos(vlen(wishvel) * f), "\n");
\r
1135 if (f > 0 && wishvel != '0 0 0')
\r
1137 self.velocity = self.velocity + wishvel * f * frametime;
\r
1138 if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
\r
1139 self.ammo_fuel -= cvar("g_jetpack_fuel") * frametime * fvel * f;
\r
1140 self.flags &~= FL_ONGROUND;
\r
1141 self.items |= IT_USING_JETPACK;
\r
1143 // jetpack also inhibits health regeneration, but only for 1 second
\r
1144 self.pauseregenhealth_finished = max(self.pauseregenhealth_finished, time + cvar("g_balance_pause_fuel_regen"));
\r
1147 else if (self.flags & FL_ONGROUND)
\r
1149 // we get here if we ran out of ammo
\r
1150 if((self.items & IT_JETPACK) && self.BUTTON_JETPACK && !(buttons_prev & 32) && !self.stat_eaten)
\r
1151 sprint(self, "You don't have any fuel for the ^2Jetpack\n");
\r
1154 makevectors(self.v_angle_y * '0 1 0');
\r
1155 wishvel = v_forward * self.movement_x + v_right * self.movement_y;
\r
1157 if(!(self.lastflags & FL_ONGROUND))
\r
1159 if(cvar("speedmeter"))
\r
1160 dprint(strcat("landing velocity: ", vtos(self.velocity), " (abs: ", ftos(vlen(self.velocity)), ")\n"));
\r
1161 if(self.lastground < time - 0.3)
\r
1162 self.velocity = self.velocity * (1 - cvar("sv_friction_on_land"));
\r
1163 if(self.jumppadcount > 1)
\r
1164 dprint(strcat(ftos(self.jumppadcount), "x jumppad combo\n"));
\r
1165 self.jumppadcount = 0;
\r
1168 #ifdef LETS_TEST_FTEQCC
\r
1169 if(self.velocity_x || self.velocity_y)
\r
1175 if(self.velocity_x)
\r
1177 if(self.velocity_y)
\r
1182 v = self.velocity;
\r
1187 if (f < sv_stopspeed)
\r
1188 f = 1 - frametime * (sv_stopspeed / f) * sv_friction;
\r
1190 f = 1 - frametime * sv_friction;
\r
1192 self.velocity = self.velocity * f;
\r
1194 self.velocity = '0 0 0';
\r
1198 wishdir = normalize(wishvel);
\r
1199 wishspeed = vlen(wishvel);
\r
1200 if (wishspeed > sv_maxspeed*maxspd_mod)
\r
1201 wishspeed = sv_maxspeed*maxspd_mod;
\r
1203 wishspeed = wishspeed * cvar("sv_crouchvelocity");
\r
1204 if (time >= self.teleport_time)
\r
1205 PM_Accelerate(wishdir, wishspeed, wishspeed, sv_accelerate*maxspd_mod, 1, 0);
\r
1210 // we get here if we ran out of ammo
\r
1211 if((self.items & IT_JETPACK) && self.BUTTON_JETPACK && !(buttons_prev & 32) && !self.stat_eaten)
\r
1212 sprint(self, "You don't have any fuel for the ^2Jetpack\n");
\r
1214 if(maxspd_mod < 1)
\r
1216 maxairspd = sv_maxairspeed*maxspd_mod;
\r
1217 airaccel = sv_airaccelerate*maxspd_mod;
\r
1221 maxairspd = sv_maxairspeed;
\r
1222 airaccel = sv_airaccelerate;
\r
1225 makevectors(self.v_angle_y * '0 1 0');
\r
1226 wishvel = v_forward * self.movement_x + v_right * self.movement_y;
\r
1228 wishdir = normalize(wishvel);
\r
1229 wishspeed = wishspeed0 = vlen(wishvel);
\r
1230 if (wishspeed0 > sv_maxspeed*maxspd_mod)
\r
1231 wishspeed0 = sv_maxspeed*maxspd_mod;
\r
1232 if (wishspeed > maxairspd)
\r
1233 wishspeed = maxairspd;
\r
1235 wishspeed = wishspeed * cvar("sv_crouchvelocity");
\r
1236 if (time >= self.teleport_time)
\r
1238 float accelerating;
\r
1242 airaccelqw = sv_airaccel_qw;
\r
1243 accelerating = (self.velocity * wishdir > 0);
\r
1244 wishspeed2 = wishspeed;
\r
1247 if(sv_airstopaccelerate)
\r
1248 if(self.velocity * wishdir < 0)
\r
1249 airaccel = sv_airstopaccelerate*maxspd_mod;
\r
1250 // this doesn't play well with analog input, but can't r
\r
1251 // fixed like the AirControl can. So, don't set the maxa
\r
1252 // cvars when you want to support analog input.
\r
1253 if(self.movement_x == 0 && self.movement_y != 0)
\r
1255 if(sv_maxairstrafespeed)
\r
1257 wishspeed = min(wishspeed, sv_maxairstrafespeed*maxspd_mod);
\r
1258 if(sv_maxairstrafespeed < sv_maxairspeed)
\r
1261 if(sv_airstrafeaccelerate)
\r
1263 airaccel = sv_airstrafeaccelerate*maxspd_mod;
\r
1264 if(sv_airstrafeaccelerate > sv_airaccelerate)
\r
1270 if(sv_warsowbunny_turnaccel && accelerating && self.movement_y == 0 && self.movement_x != 0)
\r
1271 PM_AirAccelerate(wishdir, wishspeed);
\r
1273 PM_Accelerate(wishdir, wishspeed, wishspeed0, airaccel, airaccelqw, sv_airaccel_sideways_friction / maxairspd);
\r
1276 CPM_PM_Aircontrol(wishdir, wishspeed2);
\r
1280 if((g_cts || g_race) && self.classname != "observer") {
\r
1281 if(vlen(self.velocity - self.velocity_z * '0 0 1') > speedaward_speed) {
\r
1282 speedaward_speed = vlen(self.velocity - self.velocity_z * '0 0 1');
\r
1283 speedaward_holder = self.netname;
\r
1284 speedaward_lastupdate = time;
\r
1286 if(speedaward_speed > speedaward_lastsent && time - speedaward_lastupdate > 1) {
\r
1292 race_send_speedaward(MSG_ALL);
\r
1293 speedaward_lastsent = speedaward_speed;
\r
1294 if (speedaward_speed > speedaward_alltimebest) {
\r
1295 speedaward_alltimebest = speedaward_speed;
\r
1296 speedaward_alltimebest_holder = speedaward_holder;
\r
1297 db_put(ServerProgsDB, strcat(GetMapname(), rr, "speed/speed"), ftos(speedaward_alltimebest));
\r
1298 db_put(ServerProgsDB, strcat(GetMapname(), rr, "speed/netname"), speedaward_alltimebest_holder);
\r
1299 race_send_speedaward_alltimebest(MSG_ALL);
\r
1304 if(vlen(self.velocity) > cvar("g_deathspeed"))
\r
1305 Damage(self, world, world, 100000, DEATH_KILL, self.origin, '0 0 0');
\r
1308 if(self.flags & FL_ONGROUND)
\r
1309 self.lastground = time;
\r
1311 self.lastflags = self.flags;
\r
1312 self.lastclassname = self.classname;
\r