why check down by 5000?
Code:
void player_gravity()
{
int z_offset = 0;
var z_check[2]; //vector
vec_set(z_check, my.x);
z_check[2] -= 1; //check down by 1.
z_offset = c_trace(my,z_check,IGNORE_ME + IGNORE_PASSABLE + ACTIVATE_SONAR + USE_BOX);
if (0 == z_offset) { //nothing was hit. we are at least 1+ above land
//let gravity kick in....
Move_Force[2] -= iGravity * 2 * time_step; //must be odd number ? na nm.
player_state = ps_drop;
} else {
//we must of landed ;) //recover to jump... BUGGY
if (Move_Force[2] < 0) { //ok we dropping.
if (Move_Force[2] < -20) { //down force.... no more then 20, we can keep falling if on next check :>
player_health += 0.80 * Move_Force[2];
if (player_health < 0) {
player_health = 0;
}
}
animatejump = 0;
Move_Force[2] = 0;
iRecoverJump = 8; //impossible to recover lol.
player_state = ps_drop;
// Move_Force[2] = 0;
}
if (iRecoverJump > 0) {
iRecoverJump -= 1;
}
}
return 0;
}
heres what im using now, and it works perfect. no problems as of yet...