Night Owl 8 years ago
parent
commit
cf5b2f9e14
  1. 14
      cl_dll/cdll_int.cpp
  2. 14
      dlls/client.cpp
  3. 2
      dlls/game.cpp
  4. 13
      dlls/player.cpp
  5. 8
      dlls/player.h
  6. 7
      pm_shared/pm_shared.c

14
cl_dll/cdll_int.cpp

@ -21,6 +21,7 @@ @@ -21,6 +21,7 @@
#include "hud.h"
#include "cl_util.h"
#include "netadr.h"
#include "parsemsg.h"
extern "C"
{
@ -32,10 +33,21 @@ extern "C" @@ -32,10 +33,21 @@ extern "C"
cl_enginefunc_t gEngfuncs;
CHud gHUD;
mobile_engfuncs_t *gMobileEngfuncs = NULL;
extern "C" int g_bhopcap;
void InitInput( void );
void EV_HookEvents( 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
@ -196,6 +208,8 @@ void DLLEXPORT HUD_Init( void ) @@ -196,6 +208,8 @@ void DLLEXPORT HUD_Init( void )
{
InitInput();
gHUD.Init();
gEngfuncs.pfnHookUserMsg( "Bhopcap", __MsgFunc_Bhopcap );
}
/*

14
dlls/client.cpp

@ -48,11 +48,15 @@ extern DLL_GLOBAL ULONG g_ulFrameCount; @@ -48,11 +48,15 @@ extern DLL_GLOBAL ULONG g_ulFrameCount;
extern void CopyToBodyQue( entvars_t* pev );
extern int giPrecacheGrunt;
extern int gmsgSayText;
extern int gmsgBhopcap;
extern cvar_t allow_spectators;
extern int g_teamplay;
extern cvar_t bhopcap;
extern "C" int g_bhopcap;
void LinkUserMessages( void );
/*
@ -799,8 +803,16 @@ void StartFrame( void ) @@ -799,8 +803,16 @@ void StartFrame( void )
gpGlobals->teamplay = teamplay.value;
g_ulFrameCount++;
}
int oldBhopcap = g_bhopcap;
g_bhopcap = ( 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 )
{

2
dlls/game.cpp

@ -38,6 +38,7 @@ cvar_t teamlist = { "mp_teamlist","hgrunt;scientist", FCVAR_SERVER }; @@ -38,6 +38,7 @@ cvar_t teamlist = { "mp_teamlist","hgrunt;scientist", FCVAR_SERVER };
cvar_t teamoverride = { "mp_teamoverride","1" };
cvar_t defaultteam = { "mp_defaultteam","0" };
cvar_t allowmonsters = { "mp_allowmonsters","0", FCVAR_SERVER };
cvar_t bhopcap = { "mp_bhopcap", "1", FCVAR_SERVER };
cvar_t allow_spectators = { "allow_spectators", "0", FCVAR_SERVER }; // 0 prevents players from being spectators
@ -473,6 +474,7 @@ void GameDLLInit( void ) @@ -473,6 +474,7 @@ void GameDLLInit( void )
CVAR_REGISTER( &teamoverride );
CVAR_REGISTER( &defaultteam );
CVAR_REGISTER( &allowmonsters );
CVAR_REGISTER( &bhopcap );
CVAR_REGISTER( &mp_chattime );

13
dlls/player.cpp

@ -45,6 +45,8 @@ extern DLL_GLOBAL BOOL g_fDrawLines; @@ -45,6 +45,8 @@ extern DLL_GLOBAL BOOL g_fDrawLines;
int gEvilImpulse101;
extern DLL_GLOBAL int g_iSkillLevel, gDisplayTitle;
extern "C" int g_bhopcap;
BOOL gInitHUD = TRUE;
extern void CopyToBodyQue( entvars_t *pev);
@ -181,6 +183,7 @@ int gmsgSetFOV = 0; @@ -181,6 +183,7 @@ int gmsgSetFOV = 0;
int gmsgShowMenu = 0;
int gmsgGeigerRange = 0;
int gmsgTeamNames = 0;
int gmsgBhopcap = 0;
int gmsgStatusText = 0;
int gmsgStatusValue = 0;
@ -227,6 +230,7 @@ void LinkUserMessages( void ) @@ -227,6 +230,7 @@ void LinkUserMessages( void )
gmsgFade = REG_USER_MSG( "ScreenFade", sizeof(ScreenFade) );
gmsgAmmoX = REG_USER_MSG( "AmmoX", 2 );
gmsgTeamNames = REG_USER_MSG( "TeamNames", -1 );
gmsgBhopcap = REG_USER_MSG( "Bhopcap", 1 );
gmsgStatusText = REG_USER_MSG( "StatusText", -1 );
gmsgStatusValue = REG_USER_MSG( "StatusValue", 3 );
@ -4072,6 +4076,15 @@ void CBasePlayer::UpdateClientData( void ) @@ -4072,6 +4076,15 @@ void CBasePlayer::UpdateClientData( void )
UpdateStatusBar();
m_flNextSBarUpdateTime = gpGlobals->time + 0.2;
}
// Send the current bhopcap state.
if( !m_bSentBhopcap )
{
m_bSentBhopcap = true;
MESSAGE_BEGIN( MSG_ONE, gmsgBhopcap, NULL, pev );
WRITE_BYTE( g_bhopcap );
MESSAGE_END();
}
}
//=========================================================

8
dlls/player.h

@ -313,13 +313,15 @@ public: @@ -313,13 +313,15 @@ public:
//Player ID
void InitStatusBar( void );
void UpdateStatusBar( void );
int m_izSBarState[ SBAR_END ];
int m_izSBarState[SBAR_END];
float m_flNextSBarUpdateTime;
float m_flStatusBarDisappearDelay;
char m_SbarString0[ SBAR_STRING_SIZE ];
char m_SbarString1[ SBAR_STRING_SIZE ];
char m_SbarString0[SBAR_STRING_SIZE];
char m_SbarString1[SBAR_STRING_SIZE];
float m_flNextChatTime;
bool m_bSentBhopcap; // If false, the player just joined and needs a bhopcap message.
};
#define AUTOAIM_2DEGREES 0.0348994967025

7
pm_shared/pm_shared.c

@ -27,9 +27,11 @@ @@ -27,9 +27,11 @@
#include <stdlib.h> // atoi
#include <ctype.h> // isspace
int g_bhopcap = 1;
#ifdef CLIENT_DLL
// Spectator Mode
int iJumpSpectator;
// Spectator Mode
int iJumpSpectator;
extern float vJumpOrigin[3];
extern float vJumpAngles[3];
#endif
@ -2556,6 +2558,7 @@ void PM_Jump( void ) @@ -2556,6 +2558,7 @@ void PM_Jump( void )
// In the air now.
pmove->onground = -1;
if( g_bhopcap )
PM_PreventMegaBunnyJumping();
if( tfc )

Loading…
Cancel
Save