+#include "_all.qh"
+#include "bot/bot.qh"
+#include "g_damage.qh"
+
#if defined(CSQC)
#elif defined(MENUQC)
#elif defined(SVQC)
#include "../dpdefs/progsdefs.qh"
#include "../dpdefs/dpextensions.qh"
- #include "sys-post.qh"
#include "../warpzonelib/mathlib.qh"
#include "../warpzonelib/server.qh"
#include "../common/constants.qh"
#include "../common/util.qh"
#include "../common/animdecide.qh"
#include "../common/monsters/sv_monsters.qh"
- #include "../common/weapons/weapons.qh"
+ #include "../common/weapons/all.qh"
#include "t_items.qh"
#include "autocvars.qh"
#include "defs.qh"
.entity ladder_entity;
.float gravity;
.float swamp_slowdown;
-.float lastflags;
+.int lastflags;
.float lastground;
.float wasFlying;
.float spectatorspeed;
// check for a jump-out-of-water
makevectors (self.angles);
start = self.origin;
- start_z = start.z + 8;
- v_forward_z = 0;
+ start.z = start.z + 8;
+ v_forward.z = 0;
normalize(v_forward);
end = start + v_forward*24;
traceline (start, end, true, self);
if (trace_fraction < 1)
{ // solid at waist
- start_z = start.z + self.maxs.z - 8;
+ start.z = start.z + self.maxs.z - 8;
end = start + v_forward*24;
self.movedir = trace_plane_normal * -50;
traceline (start, end, true, self);
{
vector vel_local;
- vel_local_x = v_forward * self.velocity;
- vel_local_y = v_right * self.velocity;
- vel_local_z = v_up * self.velocity;
+ vel_local.x = v_forward * self.velocity;
+ vel_local.y = v_right * self.velocity;
+ vel_local.z = v_up * self.velocity;
self.angles_x = racecar_angle(vel_local.x, vel_local.z);
self.angles_z = racecar_angle(-vel_local.y, vel_local.z);
float IsMoveInDirection(vector mv, float angle) // key mix factor
{
- if(mv_x == 0 && mv_y == 0)
+ if(mv.x == 0 && mv.y == 0)
return 0; // avoid division by zero
angle -= RAD2DEG * atan2(mv.y, mv.x);
angle = remainder(angle, 360) / 45;
return;
curvel = self.velocity;
- curvel_z = 0;
+ curvel.z = 0;
curspeed = vlen(curvel);
if(wishspeed > curspeed * 1.01)
#endif
}
-float speedaward_speed;
-string speedaward_holder;
-string speedaward_uid;
-void race_send_speedaward(float msg)
-{
- // send the best speed of the round
- WriteByte(msg, SVC_TEMPENTITY);
- WriteByte(msg, TE_CSQC_RACE);
- WriteByte(msg, RACE_NET_SPEED_AWARD);
- WriteInt24_t(msg, floor(speedaward_speed+0.5));
- WriteString(msg, speedaward_holder);
-}
-
-float speedaward_alltimebest;
-string speedaward_alltimebest_holder;
-string speedaward_alltimebest_uid;
-void race_send_speedaward_alltimebest(float msg)
-{
- // send the best speed
- WriteByte(msg, SVC_TEMPENTITY);
- WriteByte(msg, TE_CSQC_RACE);
- WriteByte(msg, RACE_NET_SPEED_AWARD_BEST);
- WriteInt24_t(msg, floor(speedaward_alltimebest+0.5));
- WriteString(msg, speedaward_alltimebest_holder);
-}
-
string GetMapname(void);
float speedaward_lastupdate;
float speedaward_lastsent;
vector wishvel, wishdir, v;
float wishspeed, f, maxspd_mod, spd, maxairspd, airaccel, swampspd_mod, buttons;
string temps;
- float buttons_prev;
+ int buttons_prev;
float not_allowed_to_move;
string c;
// fix speedhacks :P
wishvel = normalize(wishvel) * min(vlen(wishvel) / maxairspd, 1);
// add the unused velocity as up component
- wishvel_z = 0;
+ wishvel.z = 0;
// if(self.BUTTON_JUMP)
- wishvel_z = sqrt(max(0, 1 - wishvel * wishvel));
+ wishvel.z = sqrt(max(0, 1 - wishvel * wishvel));
// it is now normalized, so...
float a_side, a_up, a_add, a_diff;
wishvel.x *= fxy;
wishvel.y *= fxy;
- wishvel_z = (wishvel.z - autocvar_sv_gravity) * fz + autocvar_sv_gravity;
+ wishvel.z = (wishvel.z - autocvar_sv_gravity) * fz + autocvar_sv_gravity;
float fvel;
fvel = min(1, vlen(wishvel) / best);
}
v = self.velocity;
- v_z = 0;
+ v.z = 0;
f = vlen(v);
if(f > 0)
{
{
vector curdir;
curdir = self.velocity;
- curdir_z = 0;
+ curdir.z = 0;
curdir = normalize(curdir);
airaccel = airaccel + (autocvar_sv_airstopaccelerate*maxspd_mod - airaccel) * max(0, -(curdir * wishdir));
}