float autocvar_g_vehicle_racer_water_speed_forward;
float autocvar_g_vehicle_racer_water_speed_strafe;
+float autocvar_g_vehicle_racer_pitchlimit = 30;
+
float autocvar_g_vehicle_racer_water_downforce = 0.03;
float autocvar_g_vehicle_racer_water_upforcedamper = 15;
float uforce = autocvar_g_vehicle_racer_upforcedamper;
- if(pointcontents(self.origin - '0 0 64') == CONTENT_WATER)
+ int cont = pointcontents(self.origin - '0 0 64');
+ if(cont == CONTENT_WATER || cont == CONTENT_LAVA || cont == CONTENT_SLIME)
{
uforce = autocvar_g_vehicle_racer_water_upforcedamper;
self.velocity_z -= 1600 * sys_frametime; // 2x grav looks better for this one
}
- if(pointcontents(self.origin - '0 0 32') == CONTENT_WATER)
+ int cont = pointcontents(self.origin - '0 0 32');
+ if(cont == CONTENT_WATER || cont == CONTENT_LAVA || cont == CONTENT_SLIME)
self.velocity_z += 200;
UpdateCSQCProjectile(self);
// Pitch
ftmp = autocvar_g_vehicle_racer_pitchspeed * frametime;
ftmp = bound(-ftmp, shortangle_f(player.v_angle_x - racer.angles_x, racer.angles_x), ftmp);
- racer.angles_x = bound(-30, anglemods(racer.angles_x + ftmp), 30);
+ racer.angles_x = bound(-autocvar_g_vehicle_racer_pitchlimit, anglemods(racer.angles_x + ftmp), autocvar_g_vehicle_racer_pitchlimit);
makevectors(racer.angles);
racer.angles_x *= -1;
df = racer.velocity * -autocvar_g_vehicle_racer_friction;
//racer.velocity_z = ftmp;
+ int cont = pointcontents(racer.origin);
if(vlen(player.movement) != 0)
{
- if(pointcontents(racer.origin) == CONTENT_WATER)
+ if(cont == CONTENT_WATER || cont == CONTENT_LAVA || cont == CONTENT_SLIME)
{
if(player.movement_x) { df += v_forward * ((player.movement_x > 0) ? autocvar_g_vehicle_racer_water_speed_forward : -autocvar_g_vehicle_racer_water_speed_forward); }
if(player.movement_y) { df += v_right * ((player.movement_y > 0) ? autocvar_g_vehicle_racer_water_speed_strafe : -autocvar_g_vehicle_racer_water_speed_strafe); }
racer.wait = time;
- if(pointcontents(racer.origin) == CONTENT_WATER)
+ if(cont == CONTENT_WATER || cont == CONTENT_LAVA || cont == CONTENT_SLIME)
{
racer.vehicle_energy -= autocvar_g_vehicle_racer_waterburn_cost * frametime;
df += (v_forward * autocvar_g_vehicle_racer_waterburn_speed);
sound (racer.tur_head, CH_TRIGGER_SINGLE, "misc/null.wav", VOL_VEHICLEENGINE, ATTEN_NORM);
}
- if(pointcontents(racer.origin) == CONTENT_WATER)
+ if(cont == CONTENT_WATER || cont == CONTENT_LAVA || cont == CONTENT_SLIME)
racer.racer_watertime = time;
float dforce = autocvar_g_vehicle_racer_downforce;
float forced = autocvar_g_vehicle_racer_upforcedamper;
- if(pointcontents(self.origin - '0 0 64') == CONTENT_WATER)
+ int cont = pointcontents(self.origin - '0 0 64');
+ if(cont == CONTENT_WATER || cont == CONTENT_LAVA || cont == CONTENT_SLIME)
{
forced = autocvar_g_vehicle_racer_water_upforcedamper;
self.velocity_z += 200;
self.velocity += push_vector * _delta;
- if(pointcontents(self.origin - '0 0 64') == CONTENT_WATER)
+ int cont = pointcontents(self.origin - '0 0 64');
+ if(cont == CONTENT_WATER || cont == CONTENT_LAVA || cont == CONTENT_SLIME)
self.velocity_z += 200;
// Anti ocilation
vector df = self.velocity * -autocvar_g_vehicle_yugo_friction;
df_z += (1 - trace_fraction) * ((self.owner) ? autocvar_g_vehicle_yugo_hoverpower : autocvar_g_vehicle_yugo_hoverpower_idle) + sin(time * 2) * (autocvar_g_vehicle_yugo_springlength * 2);
- if(pointcontents(self.origin - '0 0 64') == CONTENT_WATER)
+ int cont = pointcontents(self.origin - '0 0 64');
+ if(cont == CONTENT_WATER || cont == CONTENT_LAVA || cont == CONTENT_SLIME)
self.velocity_z += 200;
self.velocity += df * pushdeltatime;