// clear buttons
PHYS_INPUT_BUTTON_ATCK(this) = false;
- PHYS_INPUT_BUTTON_JUMP(this) = false;
+ // keep jump button pressed for a short while, useful with ramp jumps
+ PHYS_INPUT_BUTTON_JUMP(this) = (!IS_DEAD(this) && time < this.bot_jump_time + 0.2);
PHYS_INPUT_BUTTON_ATCK2(this) = false;
PHYS_INPUT_BUTTON_ZOOM(this) = false;
PHYS_INPUT_BUTTON_CROUCH(this) = false;
if (can_run)
{
PHYS_INPUT_BUTTON_JUMP(this) = true;
+ this.bot_jump_time = time;
this.aistatus |= AI_STATUS_RUNNING;
}
else
dir.z = 1;
else if(this.velocity.z >= 0 && !(this.waterlevel == WATERLEVEL_WETFEET && this.watertype == CONTENT_WATER))
PHYS_INPUT_BUTTON_JUMP(this) = true;
- else
- PHYS_INPUT_BUTTON_JUMP(this) = false;
makevectors(this.v_angle.y * '0 1 0');
vector v = dir * maxspeed;
CS(this).movement.x = v * v_forward;
}
else
{
- PHYS_INPUT_BUTTON_JUMP(this) = false;
if (destorg.z > this.origin.z)
dir = flatdir;
}
)
{
PHYS_INPUT_BUTTON_JUMP(this) = true;
+ this.bot_jump_time = time;
// avoid changing route while bot is jumping a gap
navigation_goalrating_timeout_extend_if_needed(this, 1.5);
}
vector jump_height = (IS_ONGROUND(this)) ? stepheightvec + jumpheight_vec : jumpstepheightvec;
tracebox(this.origin + jump_height, this.mins, this.maxs, actual_destorg + jump_height, false, this);
if (trace_fraction > s)
+ {
PHYS_INPUT_BUTTON_JUMP(this) = true;
+ this.bot_jump_time = time;
+ }
else
{
jump_height = stepheightvec + jumpheight_vec / 2;
tracebox(this.origin + jump_height, this.mins, this.maxs, actual_destorg + jump_height, false, this);
if (trace_fraction > s)
+ {
PHYS_INPUT_BUTTON_JUMP(this) = true;
+ this.bot_jump_time = time;
+ }
}
}
}