I want to remove bunny hop(jump acceleration) from single player RTCW. I know there is some restriction on bunny hop and strafe jumping in RTCW MP. I’m working with source code, however i couldn’t find the way Nerve did that.
All that i found is PM_Checkjump in bg_pmove.c:
=============
PM_CheckJump*/
static qboolean PM_CheckJump( void ) {
// JPW NERVE – jumping in multiplayer uses and requires sprint juice (to prevent turbo skating, sprint + jumps)
// don’t allow jump accel
// if (pm->cmd.serverTime - pm->ps->jumpTime < 850)if ( pm->cmd.serverTime - pm->ps->jumpTime < 500 ) { // (SA) trying shorter time. I find this effect annoying
return qfalse;
}if ( pm->ps->pm_flags & PMF_RESPAWNED ) {
return qfalse; // don’t allow jump until all buttons are up
}if ( pm->cmd.upmove < 10 ) {
// not holding jump
return qfalse;
}// must wait for jump to be released
if ( pm->ps->pm_flags & PMF_JUMP_HELD ) {
// clear upmove so cmdscale doesn’t lower running speed
pm->cmd.upmove = 0;
return qfalse;
}pml.groundPlane = qfalse; // jumping away
pml.walking = qfalse;
pm->ps->pm_flags |= PMF_JUMP_HELD;pm->ps->groundEntityNum = ENTITYNUM_NONE;
pm->ps->velocity[2] = JUMP_VELOCITY;
PM_AddEvent( EV_JUMP );if ( pm->cmd.forwardmove >= 0 ) {
BG_AnimScriptEvent( pm->ps, ANIM_ET_JUMP, qfalse, qtrue );
pm->ps->pm_flags &= ~PMF_BACKWARDS_JUMP;
} else {
BG_AnimScriptEvent( pm->ps, ANIM_ET_JUMPBK, qfalse, qtrue );
pm->ps->pm_flags |= PMF_BACKWARDS_JUMP;
}return qtrue;
}
I think this is the right thing. However I can’t find a way to make this work in single player. Maybe someone on this forums can help me out with this?