sv_jumpmode queued and auto bunnyhop

This commit is contained in:
pierow 2018-08-01 01:01:46 -04:00
parent bec0c1a46c
commit 1cd1bf0522
5 changed files with 37 additions and 5 deletions

View File

@ -121,6 +121,7 @@ cvar_t avh_autoconcede = {kvAutoConcede, "4", FCVAR_SERVER};
cvar_t avh_combattime = {kvCombatTime, "10", FCVAR_SERVER};
cvar_t avh_mapvoteratio = {kvMapVoteRatio, ".6", FCVAR_SERVER};
cvar_t avh_blockscripts = {kvBlockScripts, "1", FCVAR_SERVER};
cvar_t avh_jumpmode = {kvJumpMode, "1", FCVAR_SERVER};
#ifdef DEBUG
cvar_t avh_testing = {kvTesting, "0", FCVAR_SERVER};
#endif
@ -230,6 +231,7 @@ void GameDLLInit( void )
CVAR_REGISTER (&avh_combattime);
CVAR_REGISTER (&avh_mapvoteratio);
CVAR_REGISTER (&avh_blockscripts);
CVAR_REGISTER (&avh_jumpmode);
// TODO: Remove
CVAR_REGISTER (&avh_ironman);

View File

@ -3156,6 +3156,16 @@ void CBasePlayer::Spawn( void )
g_engfuncs.pfnSetPhysicsKeyValue( edict(), "slj", "0" );
g_engfuncs.pfnSetPhysicsKeyValue( edict(), "hl", "1" );
if (avh_jumpmode.value == 2)
g_engfuncs.pfnSetPhysicsKeyValue(edict(), "jm2", "1");
else
g_engfuncs.pfnSetPhysicsKeyValue(edict(), "jm2", "0");
if (avh_jumpmode.value == 1)
g_engfuncs.pfnSetPhysicsKeyValue(edict(), "jm1", "1");
else
g_engfuncs.pfnSetPhysicsKeyValue(edict(), "jm1", "0");
pev->fov = m_iFOV = 0;// init field of view.
m_iClientFOV = -1; // make sure fov reset is sent

View File

@ -328,6 +328,7 @@ AvHGamerules::AvHGamerules() : mTeamA(TEAM_ONE), mTeamB(TEAM_TWO)
this->mSpawnEntity = NULL;
RegisterServerVariable(&avh_blockscripts);
RegisterServerVariable(&avh_jumpmode);
RegisterServerVariable(&avh_tournamentmode);
RegisterServerVariable(&avh_team1damagepercent);
RegisterServerVariable(&avh_team2damagepercent);

View File

@ -67,6 +67,7 @@
#include "../common/cvardef.h"
extern cvar_t avh_blockscripts;
extern cvar_t avh_jumpmode;
extern cvar_t avh_combattime;
extern cvar_t *avh_cheats;
extern cvar_t avh_defaultteam;
@ -143,5 +144,6 @@ float ns_cvar_float(const cvar_t *cvar);
#define kvMapVoteRatio "mp_mapvoteratio"
#define kvBlockScripts "mp_blockscripts"
#define kvJumpMode "sv_jumpmode"
#endif

View File

@ -132,6 +132,7 @@ bool AvHSHUGetCenterPositionForGroup(int inGroupNumber, float* inPlayerOrigin, f
float PM_GetDesiredTopDownCameraHeight(qboolean& outFoundEntity);
qboolean PM_CanWalljump();
qboolean PM_CanFlap();
qboolean jumpheld;
void PM_Overwatch();
bool PM_TopDown();
void PM_Jump(void);
@ -5334,12 +5335,14 @@ void PM_Jump (void)
{
int i;
qboolean tfc = false;
qboolean autojump = false;
qboolean queuedjump = false;
qboolean cansuperjump = false;
if (pmove->dead || GetHasUpgrade(pmove->iuser4, MASK_ENSNARED))
{
pmove->oldbuttons |= IN_JUMP ; // don't jump again until released
//pmove->oldbuttons |= IN_JUMP ; // don't jump again until released
jumpheld = true;
return;
}
@ -5449,7 +5452,7 @@ void PM_Jump (void)
// Flag that we jumped.
// HACK HACK HACK
// Remove this when the game .dll no longer does physics code!!!!
pmove->oldbuttons |= IN_JUMP; // don't jump again until released
//pmove->oldbuttons |= IN_JUMP; // don't jump again until released
return; // in air, so no effect
}
@ -5459,8 +5462,20 @@ void PM_Jump (void)
// if ( pmove->oldbuttons & IN_JUMP && (pmove->velocity[0] == 0 || !theIsAlien || pmove->iuser3 == AVH_USER3_ALIEN_PLAYER3) )
//return; // don't pogo stick
autojump = atoi(pmove->PM_Info_ValueForKey(pmove->physinfo, "jm2"));
queuedjump = atoi(pmove->PM_Info_ValueForKey(pmove->physinfo, "jm1"));
if ((!autojump && !queuedjump) || pmove->iuser3 == AVH_USER3_ALIEN_PLAYER3)
{
if (pmove->oldbuttons & IN_JUMP)
return; // don't pogo stick
}
if (queuedjump)
{
if (jumpheld)
return;
}
// In the air now.
pmove->onground = -1;
@ -5513,7 +5528,8 @@ void PM_Jump (void)
PM_FixupGravityVelocity();
// Flag that we jumped.
pmove->oldbuttons |= IN_JUMP; // don't jump again until released
//pmove->oldbuttons |= IN_JUMP; // don't jump again until released
jumpheld = true;
}
/*
@ -6678,6 +6694,7 @@ void PM_PlayerMove ( qboolean server )
else
{
pmove->oldbuttons &= ~IN_JUMP;
jumpheld = false;
}
// Fricion is handled before we add in any base velocity. That way, if we are on a conveyor,