//PHYS_INPUT_BUTTON_JUMP(this) = false;
vector movefix = '0 0 0';
- if(this.movement_x > 0) movefix_x = 1;
- if(this.movement_x < 0) movefix_x = -1;
- if(this.movement_y > 0) movefix_y = 1;
- if(this.movement_y < 0) movefix_y = -1;
+ if(CS(this).movement_x > 0) movefix_x = 1;
+ if(CS(this).movement_x < 0) movefix_x = -1;
+ if(CS(this).movement_y > 0) movefix_y = 1;
+ if(CS(this).movement_y < 0) movefix_y = -1;
vector rt = movefix_y * v_right;
vector sd = movefix_x * v_forward;
}
else if(time >= vehic.jump_delay)
{
- if(!this.movement)
+ if(!CS(this).movement)
{
if(IS_ONGROUND(vehic))
{
else
{
// Turn Body
- if(this.movement_x == 0 && this.movement_y != 0)
+ if(CS(this).movement_x == 0 && CS(this).movement_y != 0)
ftmp = autocvar_g_vehicle_spiderbot_turnspeed_strafe * PHYS_INPUT_FRAMETIME;
else
ftmp = autocvar_g_vehicle_spiderbot_turnspeed * PHYS_INPUT_FRAMETIME;
vehic.angles_y = anglemods(vehic.angles_y + ftmp);
vehic.tur_head.angles_y -= ftmp;
- if(this.movement_x != 0)
+ if(CS(this).movement_x != 0)
{
- if(this.movement_x > 0)
+ if(CS(this).movement_x > 0)
{
- this.movement_x = 1;
+ CS(this).movement_x = 1;
if(IS_ONGROUND(vehic))
vehic.frame = 0;
}
- else if(this.movement_x < 0)
+ else if(CS(this).movement_x < 0)
{
- this.movement_x = -1;
+ CS(this).movement_x = -1;
if(IS_ONGROUND(vehic))
vehic.frame = 1;
}
- this.movement_y = 0;
+ CS(this).movement_y = 0;
float oldvelz = vehic.velocity_z;
- movelib_move_simple(vehic, normalize(v_forward * this.movement_x),((PHYS_INPUT_BUTTON_JUMP(this)) ? autocvar_g_vehicle_spiderbot_speed_run : autocvar_g_vehicle_spiderbot_speed_walk),autocvar_g_vehicle_spiderbot_movement_inertia);
+ movelib_move_simple(vehic, normalize(v_forward * CS(this).movement_x),((PHYS_INPUT_BUTTON_JUMP(this)) ? autocvar_g_vehicle_spiderbot_speed_run : autocvar_g_vehicle_spiderbot_speed_walk),autocvar_g_vehicle_spiderbot_movement_inertia);
vehic.velocity_z = oldvelz;
float g = ((autocvar_sv_gameplayfix_gravityunaffectedbyticrate) ? 0.5 : 1);
if(vehic.velocity_z <= 20) // not while jumping
//dprint("spiderbot_walk:", ftos(soundlength("vehicles/spiderbot_walk.wav")), "\n");
}
}
- else if(this.movement_y != 0)
+ else if(CS(this).movement_y != 0)
{
- if(this.movement_y < 0)
+ if(CS(this).movement_y < 0)
{
- this.movement_y = -1;
+ CS(this).movement_y = -1;
if(IS_ONGROUND(vehic))
vehic.frame = 2;
}
- else if(this.movement_y > 0)
+ else if(CS(this).movement_y > 0)
{
- this.movement_y = 1;
+ CS(this).movement_y = 1;
if(IS_ONGROUND(vehic))
vehic.frame = 3;
}
float oldvelz = vehic.velocity_z;
- movelib_move_simple(vehic, normalize(v_right * this.movement_y),autocvar_g_vehicle_spiderbot_speed_strafe,autocvar_g_vehicle_spiderbot_movement_inertia);
+ movelib_move_simple(vehic, normalize(v_right * CS(this).movement_y),autocvar_g_vehicle_spiderbot_speed_strafe,autocvar_g_vehicle_spiderbot_movement_inertia);
vehic.velocity_z = oldvelz;
float g = ((autocvar_sv_gameplayfix_gravityunaffectedbyticrate) ? 0.5 : 1);
if(vehic.velocity_z <= 20) // not while jumping