.float race_penalty;
.float restart_jump;
-.float ladder_time;
-.entity ladder_entity;
.float gravity;
.float swamp_slowdown;
.float lastflags;
if (self.waterlevel >= WATERLEVEL_SWIMMING)
{
- self.velocity_z = self.stat_sv_maxspeed * 0.7;
+ self.velocity_z = PHYS_MAXSPEED(self) * 0.7;
return;
}
vector rigvel;
vector angles_save = self.angles;
- float accel = bound(-1, PHYS_INPUT_MOVEVALUES(self).x / self.stat_sv_maxspeed, 1);
- float steer = bound(-1, PHYS_INPUT_MOVEVALUES(self).y / self.stat_sv_maxspeed, 1);
+ float accel = bound(-1, PHYS_INPUT_MOVEVALUES(self).x / PHYS_MAXSPEED(self), 1);
+ float steer = bound(-1, PHYS_INPUT_MOVEVALUES(self).y / PHYS_MAXSPEED(self), 1);
if (g_bugrigs_reverse_speeding)
{
#ifdef SVQC
if (time >= self.spider_slowness)
return;
- self.stat_sv_maxspeed *= 0.5; // half speed while slow from spider
+ PHYS_MAXSPEED(self) *= 0.5; // half speed while slow from spider
self.stat_sv_airspeedlimit_nonqw *= 0.5;
#endif
}
void PM_ladder(float maxspd_mod)
{
-#ifdef SVQC
// on a spawnfunc_func_ladder or swimming in spawnfunc_func_water
UNSET_ONGROUND(self);
self.velocity = self.velocity * (1 - PHYS_INPUT_TIMELENGTH * PHYS_FRICTION);
makevectors(PHYS_INPUT_ANGLES(self));
//wishvel = v_forward * PHYS_INPUT_MOVEVALUES(self).x + v_right * PHYS_INPUT_MOVEVALUES(self).y + v_up * PHYS_INPUT_MOVEVALUES(self).z;
- vector wishvel = v_forward * PHYS_INPUT_MOVEVALUES(self).x
- + v_right * PHYS_INPUT_MOVEVALUES(self).y
- + '0 0 1' * PHYS_INPUT_MOVEVALUES(self).z;
+ vector wishvel = v_forward * PHYS_INPUT_MOVEVALUES(self)_x
+ + v_right * PHYS_INPUT_MOVEVALUES(self)_y
+ + '0 0 1' * PHYS_INPUT_MOVEVALUES(self)_z;
self.velocity_z += g;
if (self.ladder_entity.classname == "func_water")
{
}
// acceleration
vector wishdir = normalize(wishvel);
- float wishspeed = min(vlen(wishvel), self.stat_sv_maxspeed * maxspd_mod);
+ float wishspeed = min(vlen(wishvel), PHYS_MAXSPEED(self) * maxspd_mod);
+ PM_ClientMovement_Move();
+#ifdef SVQC
if (time >= self.teleport_time)
+#endif
// water acceleration
PM_Accelerate(wishdir, wishspeed, wishspeed, PHYS_ACCELERATE*maxspd_mod, 1, 0, 0, 0);
-#endif
}
void PM_jetpack(float maxspd_mod)
#ifdef SVQC
if (self.movetype == MOVETYPE_NONE)
return;
-#endif
-#ifdef SVQC
// when we get here, disableclientprediction cannot be 2
self.disableclientprediction = 0;
- if (time < self.ladder_time)
- self.disableclientprediction = 1;
#endif
PM_check_spider();
else if (self.waterlevel >= WATERLEVEL_SWIMMING)
PM_swim(maxspeed_mod);
-#ifdef SVQC
else if (time < self.ladder_time)
PM_ladder(maxspeed_mod);
-#endif
else if ((ITEMS(self) & IT_JETPACK) && PHYS_INPUT_BUTTON_HOOK(self) && (!PHYS_JETPACK_FUEL || PHYS_AMMO_FUEL(self) > 0 || (ITEMS(self) & IT_UNLIMITED_WEAPON_AMMO)) && !PHYS_FROZEN(self))
PM_jetpack(maxspeed_mod);
+.float ladder_time;
+.entity ladder_entity;
+#ifdef SVQC
.float roomtype;
.float radius;
.float pitch;
void spawnfunc_env_sound() {}
void spawnfunc_light_spot() {}
void spawnfunc_func_healthcharger() {}
-
+#endif
void func_ladder_touch()
{
+#ifdef SVQC
if (!other.iscreature)
return;
if (other.vehicle_flags & VHF_ISVEHICLE)
return;
+#endif
+#ifdef CSQC
+ if(other.classname != "csqcmodel")
+ return;
+#endif
EXACTTRIGGER_TOUCH;
+#ifdef CSQC
+ print("Setting ladder time on ", other.classname, "\n");
+#endif
+
other.ladder_time = time + 0.1;
other.ladder_entity = self;
}
+#ifdef SVQC
+float func_ladder_send(entity to, float sf)
+{
+ WriteByte(MSG_ENTITY, ENT_CLIENT_LADDER);
+
+ WriteString(MSG_ENTITY, self.classname);
+ WriteByte(MSG_ENTITY, self.warpzone_isboxy);
+ WriteByte(MSG_ENTITY, self.skin);
+ WriteByte(MSG_ENTITY, self.speed);
+ WriteByte(MSG_ENTITY, self.scale);
+ WriteCoord(MSG_ENTITY, self.origin_x);
+ WriteCoord(MSG_ENTITY, self.origin_y);
+ WriteCoord(MSG_ENTITY, self.origin_z);
+
+ WriteCoord(MSG_ENTITY, self.mins_x);
+ WriteCoord(MSG_ENTITY, self.mins_y);
+ WriteCoord(MSG_ENTITY, self.mins_z);
+ WriteCoord(MSG_ENTITY, self.maxs_x);
+ WriteCoord(MSG_ENTITY, self.maxs_y);
+ WriteCoord(MSG_ENTITY, self.maxs_z);
+
+ WriteCoord(MSG_ENTITY, self.movedir_x);
+ WriteCoord(MSG_ENTITY, self.movedir_y);
+ WriteCoord(MSG_ENTITY, self.movedir_z);
+
+ WriteCoord(MSG_ENTITY, self.angles_x);
+ WriteCoord(MSG_ENTITY, self.angles_y);
+ WriteCoord(MSG_ENTITY, self.angles_z);
+
+ return TRUE;
+}
+
+void func_ladder_link()
+{
+ self.nextthink = time;
+ Net_LinkEntity(self, FALSE, 0, func_ladder_send);
+ self.nextthink = 0;
+}
+
void spawnfunc_func_ladder()
{
EXACTTRIGGER_INIT;
self.touch = func_ladder_touch;
+
+ func_ladder_link();
}
void spawnfunc_func_water()
{
EXACTTRIGGER_INIT;
self.touch = func_ladder_touch;
+
+ func_ladder_link();
+}
+
+#elif defined(CSQC)
+.float speed;
+
+void func_ladder_draw()
+{
+ tracebox(self.origin, self.mins, self.maxs, self.origin, MOVE_NORMAL, self);
+
+ if(trace_fraction < 1)
+ if(trace_ent)
+ {
+ other = trace_ent;
+ func_ladder_touch();
+ }
}
+void ent_func_ladder()
+{
+ self.classname = strzone(ReadString());
+ self.warpzone_isboxy = ReadByte();
+ self.skin = ReadByte();
+ self.speed = ReadByte();
+ self.scale = ReadByte();
+ self.origin_x = ReadCoord();
+ self.origin_y = ReadCoord();
+ self.origin_z = ReadCoord();
+ setorigin(self, self.origin);
+ self.mins_x = ReadCoord();
+ self.mins_y = ReadCoord();
+ self.mins_z = ReadCoord();
+ self.maxs_x = ReadCoord();
+ self.maxs_y = ReadCoord();
+ self.maxs_z = ReadCoord();
+ setsize(self, self.mins, self.maxs);
+ self.movedir_x = ReadCoord();
+ self.movedir_y = ReadCoord();
+ self.movedir_z = ReadCoord();
+ self.angles_x = ReadCoord();
+ self.angles_y = ReadCoord();
+ self.angles_z = ReadCoord();
+
+ self.solid = SOLID_TRIGGER;
+ self.draw = func_ladder_draw;
+ self.drawmask = MASK_NORMAL;
+}
+#endif