Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 20 additions & 1 deletion src/game/client/c_baseplayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,10 @@ END_RECV_TABLE()

RecvPropVector ( RECVINFO( m_vecBaseVelocity ) ),

#ifdef OPENMOD
RecvPropVector(RECVINFO(m_vecUseAngles)),
#endif // OPENMOD

RecvPropEHandle ( RECVINFO( m_hConstraintEntity)),
RecvPropVector ( RECVINFO( m_vecConstraintCenter) ),
RecvPropFloat ( RECVINFO( m_flConstraintRadius )),
Expand Down Expand Up @@ -295,7 +299,9 @@ END_RECV_TABLE()

RecvPropFloat (RECVINFO(m_flMaxspeed)),
RecvPropInt (RECVINFO(m_fFlags)),

#if defined OPENMOD
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what the fuck is that syntax

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if defined is ifdef.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

did you even try to compile it?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it compiles

RecvPropVector(RECVINFO(m_vecUseAngles)),
#endif

RecvPropInt (RECVINFO(m_iObserverMode), 0, RecvProxy_ObserverMode ),
RecvPropEHandle (RECVINFO(m_hObserverTarget), RecvProxy_ObserverTarget ),
Expand Down Expand Up @@ -1418,6 +1424,19 @@ void C_BasePlayer::CreateWaterEffects( void )
//-----------------------------------------------------------------------------
void C_BasePlayer::OverrideView( CViewSetup *pSetup )
{
#ifdef OPENMOD
C_BaseCombatWeapon* pWeapon = GetActiveWeapon();
if (pWeapon)
{
// adnan
if (pWeapon->OverrideViewAngles()) {
// use the useAngles!
// override with the angles the server sends to us as useAngles
// use the useAngles only if we're holding and rotating with the grav gun
pSetup->angles = m_vecUseAngles;
}
}
#endif // OPENMOD
}

bool C_BasePlayer::ShouldInterpolate()
Expand Down
3 changes: 3 additions & 0 deletions src/game/client/c_baseplayer.h
Original file line number Diff line number Diff line change
Expand Up @@ -440,6 +440,9 @@ class C_BasePlayer : public C_BaseCombatCharacter, public CGameEventListener

CUserCmd *m_pCurrentCommand;

#if defined OPENMOD
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and you did it again

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

again, if defined is ifdef.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

again, did you even try to compile it?

QAngle m_vecUseAngles;
#endif
// Movement constraints
EHANDLE m_hConstraintEntity;
Vector m_vecConstraintCenter;
Expand Down
3 changes: 2 additions & 1 deletion src/game/client/client_openmod.vpc
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ $Configuration
$Compiler
{
$AdditionalIncludeDirectories "$BASE;hl2mp\ui,.\hl2mp,$SRCDIR\game\shared\hl2mp,.\hl2,.\hl2\elements,$SRCDIR\game\shared\hl2,.\openmod,$SRCDIR\game\shared\openmod"
$PreprocessorDefinitions "$BASE;HL2MP;HL2_CLIENT_DLL;NEXT_BOT;OPENMOD"
$PreprocessorDefinitions "$BASE;HL2MP;HL2_CLIENT_DLL;NEXT_BOT;OPENMOD;OMOD"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what.

}
}

Expand Down Expand Up @@ -42,6 +42,7 @@ $Project "Client (OpenMod)"

$Folder "OpenMod"
{
$File "..\shared\openmod\weapon_physgun.cpp"
$Folder "Lua"
{
$File "$SRCDIR\game\shared\openmod\lua\luamanager.cpp"
Expand Down
15 changes: 15 additions & 0 deletions src/game/client/clientmode_shared.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -519,6 +519,21 @@ void ClientModeShared::OverrideMouseInput( float *x, float *y )
}
}

#ifdef OPENMOD

bool ClientModeShared::OverrideViewAngles(void)
{
C_BaseCombatWeapon* pWeapon = GetActiveWeapon();
if (pWeapon)
{
return pWeapon->OverrideViewAngles();
}
return false;
}

#endif // OPENMOD


//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
Expand Down
1 change: 1 addition & 0 deletions src/game/client/clientmode_shared.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ class ClientModeShared : public IClientMode, public CGameEventListener

// Input
virtual int KeyInput( int down, ButtonCode_t keynum, const char *pszCurrentBinding );
virtual bool OverrideViewAngles(void);
virtual int HudElementKeyInput( int down, ButtonCode_t keynum, const char *pszCurrentBinding );
virtual void OverrideMouseInput( float *x, float *y );
virtual void StartMessageMode( int iMessageModeType );
Expand Down
1 change: 1 addition & 0 deletions src/game/client/hl2mp/c_hl2mp_player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#include "iviewrender_beams.h" // flashlight beam
#include "r_efx.h"
#include "dlight.h"
#include "iclientmode.h"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

useless


// Don't alias here
#if defined( CHL2MP_Player )
Expand Down
13 changes: 13 additions & 0 deletions src/game/client/hud.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,11 @@ CHud::CHud()
SetDefLessFunc( m_RenderGroups );

m_flScreenShotTime = -1;

#ifdef OPENMOD
m_bSkipClear = false;
#endif // OPENMOD

}

//-----------------------------------------------------------------------------
Expand Down Expand Up @@ -1178,8 +1183,16 @@ bool CHud::DoesRenderGroupExist( int iGroupIndex )
//-----------------------------------------------------------------------------
void CHud::UpdateHud( bool bActive )
{
#ifndef OPENMOD
// clear the weapon bits.
gHUD.m_iKeyBits &= (~(IN_WEAPON1|IN_WEAPON2));
#else
if (!gHUD.m_bSkipClear)
{
// clear the weapon bits.
gHUD.m_iKeyBits &= (~(IN_WEAPON1 | IN_WEAPON2));
}
#endif

g_pClientMode->Update();

Expand Down
3 changes: 3 additions & 0 deletions src/game/client/hud.h
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,9 @@ class CHud
public:

int m_iKeyBits;
#ifdef OPENMOD
bool m_bSkipClear;
#endif // OPENMOD
#ifndef _XBOX
float m_flMouseSensitivity;
float m_flMouseSensitivityFactor;
Expand Down
1 change: 1 addition & 0 deletions src/game/client/iclientmode.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ abstract_class IClientMode
virtual int KeyInput( int down, ButtonCode_t keynum, const char *pszCurrentBinding ) = 0;
virtual void StartMessageMode( int iMessageModeType ) = 0;
virtual vgui::Panel *GetMessagePanel() = 0;
virtual bool OverrideViewAngles(void) = 0;
virtual void OverrideMouseInput( float *x, float *y ) = 0;
virtual bool CreateMove( float flInputSampleTime, CUserCmd *cmd ) = 0;

Expand Down
13 changes: 11 additions & 2 deletions src/game/client/in_mouse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -740,8 +740,17 @@ void CInput::MouseMove( CUserCmd *cmd )
ResetMouse();
}

// Store out the new viewangles.
engine->SetViewAngles( viewangles );
#if defined(OPENMOD)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#else.......

// adnan
// only set the new viewangles if we're not supposed to override them
if (!(g_pClientMode->OverrideViewAngles()))
{

// Store out the new viewangles.
engine->SetViewAngles(viewangles);
}
// end adnan
#endif
}

//-----------------------------------------------------------------------------
Expand Down
7 changes: 6 additions & 1 deletion src/game/server/player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,9 @@ BEGIN_DATADESC( CBasePlayer )
DEFINE_FIELD( m_flOldPlayerViewOffsetZ, FIELD_FLOAT ),
DEFINE_FIELD( m_bPlayerUnderwater, FIELD_BOOLEAN ),
DEFINE_FIELD( m_hViewEntity, FIELD_EHANDLE ),

#if defined(OPENMOD)
DEFINE_FIELD(m_vecUseAngles, FIELD_VECTOR),
#endif
DEFINE_FIELD( m_hConstraintEntity, FIELD_EHANDLE ),
DEFINE_FIELD( m_vecConstraintCenter, FIELD_VECTOR ),
DEFINE_FIELD( m_flConstraintRadius, FIELD_FLOAT ),
Expand Down Expand Up @@ -8143,6 +8145,9 @@ void CMovementSpeedMod::InputSpeedMod(inputdata_t &data)

SendPropVector ( SENDINFO( m_vecBaseVelocity ), 32, SPROP_NOSCALE ),

#if defined(OPENMOD)
SendPropVector(SENDINFO(m_vecUseAngles), 0, SPROP_NOSCALE),
#endif
SendPropEHandle ( SENDINFO( m_hConstraintEntity)),
SendPropVector ( SENDINFO( m_vecConstraintCenter), 0, SPROP_NOSCALE ),
SendPropFloat ( SENDINFO( m_flConstraintRadius ), 0, SPROP_NOSCALE ),
Expand Down
3 changes: 3 additions & 0 deletions src/game/server/player.h
Original file line number Diff line number Diff line change
Expand Up @@ -1150,6 +1150,9 @@ class CBasePlayer : public CBaseCombatCharacter

EHANDLE m_hViewEntity;

#if defined(OPENMOD)
CNetworkQAngle(m_vecUseAngles);
#endif
// Movement constraints
CNetworkHandle( CBaseEntity, m_hConstraintEntity );
CNetworkVector( m_vecConstraintCenter );
Expand Down
2 changes: 2 additions & 0 deletions src/game/server/server_openmod.vpc
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,8 @@ $Project "Server (OpenMod)"

$Folder "OpenMod"
{

$File "..\shared\openmod\weapon_physgun.cpp"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$SRCDIR\game\shared\openmod\weapon_physgun.cpp.....

$Folder "Lua"
{
$File "$SRCDIR\game\shared\openmod\lua\luamanager.cpp"
Expand Down
3 changes: 3 additions & 0 deletions src/game/shared/basecombatweapon_shared.h
Original file line number Diff line number Diff line change
Expand Up @@ -497,6 +497,9 @@ class CBaseCombatWeapon : public BASECOMBATWEAPON_DERIVED_FROM
virtual bool ShouldDraw( void );
virtual bool ShouldDrawPickup( void );
virtual void HandleInput( void ) { return; };
#ifdef OPENMOD
virtual bool OverrideViewAngles(void) { return false; };
#endif // OPENMOD
virtual void OverrideMouseInput( float *x, float *y ) { return; };
virtual int KeyInput( int down, ButtonCode_t keynum, const char *pszCurrentBinding ) { return 1; }
virtual bool AddLookShift( void ) { return true; };
Expand Down
Loading