mirror of
https://github.com/YGGverse/hlsdk-portable.git
synced 2025-02-02 10:05:38 +00:00
Change bunnyhop cap via movevar.
This commit is contained in:
parent
a4a2b34386
commit
aec0f79806
@ -50,20 +50,10 @@ TeamFortressViewport *gViewPort = NULL;
|
|||||||
#endif
|
#endif
|
||||||
mobile_engfuncs_t *gMobileEngfuncs = NULL;
|
mobile_engfuncs_t *gMobileEngfuncs = NULL;
|
||||||
|
|
||||||
extern "C" int g_bhopcap;
|
|
||||||
void InitInput( void );
|
void InitInput( void );
|
||||||
void EV_HookEvents( void );
|
void EV_HookEvents( void );
|
||||||
void IN_Commands( void );
|
void IN_Commands( void );
|
||||||
|
|
||||||
int __MsgFunc_Bhopcap( const char *pszName, int iSize, void *pbuf )
|
|
||||||
{
|
|
||||||
BEGIN_READ( pbuf, iSize );
|
|
||||||
|
|
||||||
g_bhopcap = READ_BYTE();
|
|
||||||
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
==========================
|
==========================
|
||||||
Initialize
|
Initialize
|
||||||
@ -299,8 +289,6 @@ void DLLEXPORT HUD_Init( void )
|
|||||||
#if USE_VGUI
|
#if USE_VGUI
|
||||||
Scheme_Init();
|
Scheme_Init();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
gEngfuncs.pfnHookUserMsg( "Bhopcap", __MsgFunc_Bhopcap );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -48,16 +48,12 @@ extern DLL_GLOBAL ULONG g_ulFrameCount;
|
|||||||
extern void CopyToBodyQue( entvars_t* pev );
|
extern void CopyToBodyQue( entvars_t* pev );
|
||||||
extern int giPrecacheGrunt;
|
extern int giPrecacheGrunt;
|
||||||
extern int gmsgSayText;
|
extern int gmsgSayText;
|
||||||
extern int gmsgBhopcap;
|
|
||||||
|
|
||||||
extern cvar_t allow_spectators;
|
extern cvar_t allow_spectators;
|
||||||
extern cvar_t multibyte_only;
|
extern cvar_t multibyte_only;
|
||||||
|
|
||||||
extern int g_teamplay;
|
extern int g_teamplay;
|
||||||
|
|
||||||
extern cvar_t bhopcap;
|
|
||||||
extern "C" int g_bhopcap;
|
|
||||||
|
|
||||||
void LinkUserMessages( void );
|
void LinkUserMessages( void );
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -822,15 +818,6 @@ void StartFrame( void )
|
|||||||
|
|
||||||
gpGlobals->teamplay = teamplay.value;
|
gpGlobals->teamplay = teamplay.value;
|
||||||
g_ulFrameCount++;
|
g_ulFrameCount++;
|
||||||
|
|
||||||
int oldBhopcap = g_bhopcap;
|
|
||||||
g_bhopcap = ( g_pGameRules && g_pGameRules->IsMultiplayer() && bhopcap.value != 0.0f ) ? 1 : 0;
|
|
||||||
if( g_bhopcap != oldBhopcap )
|
|
||||||
{
|
|
||||||
MESSAGE_BEGIN( MSG_ALL, gmsgBhopcap, NULL );
|
|
||||||
WRITE_BYTE( g_bhopcap );
|
|
||||||
MESSAGE_END();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ClientPrecache( void )
|
void ClientPrecache( void )
|
||||||
|
@ -42,6 +42,7 @@ extern cvar_t teamlist;
|
|||||||
extern cvar_t teamoverride;
|
extern cvar_t teamoverride;
|
||||||
extern cvar_t defaultteam;
|
extern cvar_t defaultteam;
|
||||||
extern cvar_t allowmonsters;
|
extern cvar_t allowmonsters;
|
||||||
|
extern cvar_t bhopcap;
|
||||||
|
|
||||||
// Engine Cvars
|
// Engine Cvars
|
||||||
extern cvar_t *g_psv_gravity;
|
extern cvar_t *g_psv_gravity;
|
||||||
|
@ -45,8 +45,6 @@ extern DLL_GLOBAL BOOL g_fDrawLines;
|
|||||||
int gEvilImpulse101;
|
int gEvilImpulse101;
|
||||||
extern DLL_GLOBAL int g_iSkillLevel, gDisplayTitle;
|
extern DLL_GLOBAL int g_iSkillLevel, gDisplayTitle;
|
||||||
|
|
||||||
extern "C" int g_bhopcap;
|
|
||||||
|
|
||||||
BOOL gInitHUD = TRUE;
|
BOOL gInitHUD = TRUE;
|
||||||
|
|
||||||
extern void CopyToBodyQue( entvars_t *pev);
|
extern void CopyToBodyQue( entvars_t *pev);
|
||||||
@ -183,7 +181,6 @@ int gmsgSetFOV = 0;
|
|||||||
int gmsgShowMenu = 0;
|
int gmsgShowMenu = 0;
|
||||||
int gmsgGeigerRange = 0;
|
int gmsgGeigerRange = 0;
|
||||||
int gmsgTeamNames = 0;
|
int gmsgTeamNames = 0;
|
||||||
int gmsgBhopcap = 0;
|
|
||||||
|
|
||||||
int gmsgStatusText = 0;
|
int gmsgStatusText = 0;
|
||||||
int gmsgStatusValue = 0;
|
int gmsgStatusValue = 0;
|
||||||
@ -230,7 +227,6 @@ void LinkUserMessages( void )
|
|||||||
gmsgFade = REG_USER_MSG( "ScreenFade", sizeof(ScreenFade) );
|
gmsgFade = REG_USER_MSG( "ScreenFade", sizeof(ScreenFade) );
|
||||||
gmsgAmmoX = REG_USER_MSG( "AmmoX", 2 );
|
gmsgAmmoX = REG_USER_MSG( "AmmoX", 2 );
|
||||||
gmsgTeamNames = REG_USER_MSG( "TeamNames", -1 );
|
gmsgTeamNames = REG_USER_MSG( "TeamNames", -1 );
|
||||||
gmsgBhopcap = REG_USER_MSG( "Bhopcap", 1 );
|
|
||||||
|
|
||||||
gmsgStatusText = REG_USER_MSG( "StatusText", -1 );
|
gmsgStatusText = REG_USER_MSG( "StatusText", -1 );
|
||||||
gmsgStatusValue = REG_USER_MSG( "StatusValue", 3 );
|
gmsgStatusValue = REG_USER_MSG( "StatusValue", 3 );
|
||||||
@ -2816,6 +2812,7 @@ 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" );
|
||||||
g_engfuncs.pfnSetPhysicsKeyValue( edict(), "fr", "1" );
|
g_engfuncs.pfnSetPhysicsKeyValue( edict(), "fr", "1" );
|
||||||
|
g_engfuncs.pfnSetPhysicsKeyValue( edict(), "bj", bhopcap.value ? "0" : "1" );
|
||||||
|
|
||||||
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
|
||||||
@ -3347,7 +3344,6 @@ void CBasePlayer::ForceClientDllUpdate( void )
|
|||||||
m_fWeapon = FALSE; // Force weapon send
|
m_fWeapon = FALSE; // Force weapon send
|
||||||
m_fKnownItem = FALSE; // Force weaponinit messages.
|
m_fKnownItem = FALSE; // Force weaponinit messages.
|
||||||
m_fInitHUD = TRUE; // Force HUD gmsgResetHUD message
|
m_fInitHUD = TRUE; // Force HUD gmsgResetHUD message
|
||||||
m_bSentBhopcap = true; // a1ba: Update bhopcap state
|
|
||||||
memset( m_rgAmmoLast, 0, sizeof( m_rgAmmoLast )); // a1ba: Force update AmmoX
|
memset( m_rgAmmoLast, 0, sizeof( m_rgAmmoLast )); // a1ba: Force update AmmoX
|
||||||
|
|
||||||
|
|
||||||
@ -4114,15 +4110,6 @@ void CBasePlayer::UpdateClientData( void )
|
|||||||
UpdateStatusBar();
|
UpdateStatusBar();
|
||||||
m_flNextSBarUpdateTime = gpGlobals->time + 0.2f;
|
m_flNextSBarUpdateTime = gpGlobals->time + 0.2f;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Send the current bhopcap state.
|
|
||||||
if( !m_bSentBhopcap )
|
|
||||||
{
|
|
||||||
m_bSentBhopcap = true;
|
|
||||||
MESSAGE_BEGIN( MSG_ONE, gmsgBhopcap, NULL, pev );
|
|
||||||
WRITE_BYTE( g_bhopcap );
|
|
||||||
MESSAGE_END();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//=========================================================
|
//=========================================================
|
||||||
|
@ -328,8 +328,6 @@ public:
|
|||||||
int m_iAutoWepSwitch;
|
int m_iAutoWepSwitch;
|
||||||
|
|
||||||
Vector m_vecLastViewAngles;
|
Vector m_vecLastViewAngles;
|
||||||
|
|
||||||
bool m_bSentBhopcap; // If false, the player just joined and needs a bhopcap message.
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#define AUTOAIM_2DEGREES 0.0348994967025
|
#define AUTOAIM_2DEGREES 0.0348994967025
|
||||||
|
@ -31,8 +31,6 @@
|
|||||||
#include "pm_movevars.h"
|
#include "pm_movevars.h"
|
||||||
#include "pm_debug.h"
|
#include "pm_debug.h"
|
||||||
|
|
||||||
int g_bhopcap = 1;
|
|
||||||
|
|
||||||
#if CLIENT_DLL
|
#if CLIENT_DLL
|
||||||
// Spectator Mode
|
// Spectator Mode
|
||||||
int iJumpSpectator;
|
int iJumpSpectator;
|
||||||
@ -2481,6 +2479,8 @@ PM_Jump
|
|||||||
void PM_Jump( void )
|
void PM_Jump( void )
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
qboolean bunnyjump = false;
|
||||||
|
|
||||||
qboolean tfc = false;
|
qboolean tfc = false;
|
||||||
|
|
||||||
qboolean cansuperjump = false;
|
qboolean cansuperjump = false;
|
||||||
@ -2564,7 +2564,10 @@ void PM_Jump( void )
|
|||||||
// In the air now.
|
// In the air now.
|
||||||
pmove->onground = -1;
|
pmove->onground = -1;
|
||||||
|
|
||||||
if( g_bhopcap )
|
if( pmove->multiplayer )
|
||||||
|
bunnyjump = atoi( pmove->PM_Info_ValueForKey( pmove->physinfo, "bj" ) ) ? true : false;
|
||||||
|
|
||||||
|
if( !bunnyjump )
|
||||||
PM_PreventMegaBunnyJumping();
|
PM_PreventMegaBunnyJumping();
|
||||||
|
|
||||||
if( tfc )
|
if( tfc )
|
||||||
|
Loading…
x
Reference in New Issue
Block a user