mirror of https://github.com/ENSL/NS.git
sv_jumpmode queued and auto bunnyhop
This commit is contained in:
parent
bec0c1a46c
commit
1cd1bf0522
|
@ -121,6 +121,7 @@ cvar_t avh_autoconcede = {kvAutoConcede, "4", FCVAR_SERVER};
|
||||||
cvar_t avh_combattime = {kvCombatTime, "10", FCVAR_SERVER};
|
cvar_t avh_combattime = {kvCombatTime, "10", FCVAR_SERVER};
|
||||||
cvar_t avh_mapvoteratio = {kvMapVoteRatio, ".6", FCVAR_SERVER};
|
cvar_t avh_mapvoteratio = {kvMapVoteRatio, ".6", FCVAR_SERVER};
|
||||||
cvar_t avh_blockscripts = {kvBlockScripts, "1", FCVAR_SERVER};
|
cvar_t avh_blockscripts = {kvBlockScripts, "1", FCVAR_SERVER};
|
||||||
|
cvar_t avh_jumpmode = {kvJumpMode, "1", FCVAR_SERVER};
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
cvar_t avh_testing = {kvTesting, "0", FCVAR_SERVER};
|
cvar_t avh_testing = {kvTesting, "0", FCVAR_SERVER};
|
||||||
#endif
|
#endif
|
||||||
|
@ -230,6 +231,7 @@ void GameDLLInit( void )
|
||||||
CVAR_REGISTER (&avh_combattime);
|
CVAR_REGISTER (&avh_combattime);
|
||||||
CVAR_REGISTER (&avh_mapvoteratio);
|
CVAR_REGISTER (&avh_mapvoteratio);
|
||||||
CVAR_REGISTER (&avh_blockscripts);
|
CVAR_REGISTER (&avh_blockscripts);
|
||||||
|
CVAR_REGISTER (&avh_jumpmode);
|
||||||
|
|
||||||
// TODO: Remove
|
// TODO: Remove
|
||||||
CVAR_REGISTER (&avh_ironman);
|
CVAR_REGISTER (&avh_ironman);
|
||||||
|
|
|
@ -3156,6 +3156,16 @@ void CBasePlayer::Spawn( void )
|
||||||
g_engfuncs.pfnSetPhysicsKeyValue( edict(), "slj", "0" );
|
g_engfuncs.pfnSetPhysicsKeyValue( edict(), "slj", "0" );
|
||||||
g_engfuncs.pfnSetPhysicsKeyValue( edict(), "hl", "1" );
|
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.
|
pev->fov = m_iFOV = 0;// init field of view.
|
||||||
m_iClientFOV = -1; // make sure fov reset is sent
|
m_iClientFOV = -1; // make sure fov reset is sent
|
||||||
|
|
||||||
|
|
|
@ -328,6 +328,7 @@ AvHGamerules::AvHGamerules() : mTeamA(TEAM_ONE), mTeamB(TEAM_TWO)
|
||||||
this->mSpawnEntity = NULL;
|
this->mSpawnEntity = NULL;
|
||||||
|
|
||||||
RegisterServerVariable(&avh_blockscripts);
|
RegisterServerVariable(&avh_blockscripts);
|
||||||
|
RegisterServerVariable(&avh_jumpmode);
|
||||||
RegisterServerVariable(&avh_tournamentmode);
|
RegisterServerVariable(&avh_tournamentmode);
|
||||||
RegisterServerVariable(&avh_team1damagepercent);
|
RegisterServerVariable(&avh_team1damagepercent);
|
||||||
RegisterServerVariable(&avh_team2damagepercent);
|
RegisterServerVariable(&avh_team2damagepercent);
|
||||||
|
|
|
@ -67,6 +67,7 @@
|
||||||
#include "../common/cvardef.h"
|
#include "../common/cvardef.h"
|
||||||
|
|
||||||
extern cvar_t avh_blockscripts;
|
extern cvar_t avh_blockscripts;
|
||||||
|
extern cvar_t avh_jumpmode;
|
||||||
extern cvar_t avh_combattime;
|
extern cvar_t avh_combattime;
|
||||||
extern cvar_t *avh_cheats;
|
extern cvar_t *avh_cheats;
|
||||||
extern cvar_t avh_defaultteam;
|
extern cvar_t avh_defaultteam;
|
||||||
|
@ -143,5 +144,6 @@ float ns_cvar_float(const cvar_t *cvar);
|
||||||
#define kvMapVoteRatio "mp_mapvoteratio"
|
#define kvMapVoteRatio "mp_mapvoteratio"
|
||||||
|
|
||||||
#define kvBlockScripts "mp_blockscripts"
|
#define kvBlockScripts "mp_blockscripts"
|
||||||
|
#define kvJumpMode "sv_jumpmode"
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -132,6 +132,7 @@ bool AvHSHUGetCenterPositionForGroup(int inGroupNumber, float* inPlayerOrigin, f
|
||||||
float PM_GetDesiredTopDownCameraHeight(qboolean& outFoundEntity);
|
float PM_GetDesiredTopDownCameraHeight(qboolean& outFoundEntity);
|
||||||
qboolean PM_CanWalljump();
|
qboolean PM_CanWalljump();
|
||||||
qboolean PM_CanFlap();
|
qboolean PM_CanFlap();
|
||||||
|
qboolean jumpheld;
|
||||||
void PM_Overwatch();
|
void PM_Overwatch();
|
||||||
bool PM_TopDown();
|
bool PM_TopDown();
|
||||||
void PM_Jump(void);
|
void PM_Jump(void);
|
||||||
|
@ -5334,12 +5335,14 @@ void PM_Jump (void)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
qboolean tfc = false;
|
qboolean tfc = false;
|
||||||
|
qboolean autojump = false;
|
||||||
|
qboolean queuedjump = false;
|
||||||
qboolean cansuperjump = false;
|
qboolean cansuperjump = false;
|
||||||
|
|
||||||
if (pmove->dead || GetHasUpgrade(pmove->iuser4, MASK_ENSNARED))
|
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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5449,7 +5452,7 @@ void PM_Jump (void)
|
||||||
// Flag that we jumped.
|
// Flag that we jumped.
|
||||||
// HACK HACK HACK
|
// HACK HACK HACK
|
||||||
// Remove this when the game .dll no longer does physics code!!!!
|
// 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
|
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) )
|
// if ( pmove->oldbuttons & IN_JUMP && (pmove->velocity[0] == 0 || !theIsAlien || pmove->iuser3 == AVH_USER3_ALIEN_PLAYER3) )
|
||||||
//return; // don't pogo stick
|
//return; // don't pogo stick
|
||||||
|
|
||||||
if ( pmove->oldbuttons & IN_JUMP )
|
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
|
return; // don't pogo stick
|
||||||
|
}
|
||||||
|
|
||||||
|
if (queuedjump)
|
||||||
|
{
|
||||||
|
if (jumpheld)
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// In the air now.
|
// In the air now.
|
||||||
pmove->onground = -1;
|
pmove->onground = -1;
|
||||||
|
@ -5513,7 +5528,8 @@ void PM_Jump (void)
|
||||||
PM_FixupGravityVelocity();
|
PM_FixupGravityVelocity();
|
||||||
|
|
||||||
// Flag that we jumped.
|
// 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
|
else
|
||||||
{
|
{
|
||||||
pmove->oldbuttons &= ~IN_JUMP;
|
pmove->oldbuttons &= ~IN_JUMP;
|
||||||
|
jumpheld = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Fricion is handled before we add in any base velocity. That way, if we are on a conveyor,
|
// Fricion is handled before we add in any base velocity. That way, if we are on a conveyor,
|
||||||
|
|
Loading…
Reference in New Issue