sys_marker("CH3");
//TEST JUMPING
if(var_level_number == 0)
{
jump_test = c_trace(my.x,vector(my.x,my.y,my.z-2048),IGNORE_ME|IGNORE_PASSABLE|USE_POLYGON|IGNORE_FLAG2|USE_BOX);
}
else
{
jump_test = c_trace(my.x,vector(my.x,my.y,my.z-2048),IGNORE_ME|IGNORE_PASSABLE|USE_POLYGON|IGNORE_FLAG2);
}
if(jump_test > 0)//stores last reliable surface position
{
surface_z = hit.z;
}
if(var_jump == 1 && ((jump_test <= my_height) || (hit.entity.skill1 == 62 && on_ground = 1)))
{
if(jump_wait <= 0 && on_ground != 1)
{
if(!snd_playing(land_handle))
{
land_handle = snd_play(snd_land,100 * (main_volume/100),0);
}
}
on_ground = 0;
jumping = var_jump_amount;//5.0
}
else if(jump_test > my_height)
{
if(hit.entity.skill1 == 62 && jumping == 0 && jump_test < 32)
{
on_ground = 1;
my.z = surface_z + my_height;
}
else
{
on_ground = 0;
jumping -= 1.2 * time_step;
}
}
else
{
if(on_ground == 0 && jumping < -4)
{
if(!snd_playing(land_handle))
{
land_handle = snd_play(snd_land,100 * (main_volume/100),0);
}
}
on_ground = 1;
my.z = surface_z + my_height;
jumping = 0;
}
sys_marker("CH4");