mirror of
https://github.com/mapbase-source/source-sdk-2013.git
synced 2024-12-28 15:55:31 +03:00
Added "Disable flashlight" keyvalue/inputs inspired by Portal 2's
This commit is contained in:
parent
bd3b9c3807
commit
15ae789b89
@ -578,6 +578,7 @@ BEGIN_RECV_TABLE_NOBASE(C_BaseEntity, DT_BaseEntity)
|
|||||||
RecvPropInt(RECVINFO(m_clrRender)),
|
RecvPropInt(RECVINFO(m_clrRender)),
|
||||||
#ifdef MAPBASE
|
#ifdef MAPBASE
|
||||||
RecvPropInt(RECVINFO(m_iViewHideFlags)),
|
RecvPropInt(RECVINFO(m_iViewHideFlags)),
|
||||||
|
RecvPropBool(RECVINFO(m_bDisableFlashlight)),
|
||||||
#endif
|
#endif
|
||||||
RecvPropInt(RECVINFO(m_iTeamNum)),
|
RecvPropInt(RECVINFO(m_iTeamNum)),
|
||||||
RecvPropInt(RECVINFO(m_CollisionGroup)),
|
RecvPropInt(RECVINFO(m_CollisionGroup)),
|
||||||
@ -1683,6 +1684,11 @@ bool C_BaseEntity::ShouldReceiveProjectedTextures( int flags )
|
|||||||
if ( IsEffectActive( EF_NODRAW ) )
|
if ( IsEffectActive( EF_NODRAW ) )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
#ifdef MAPBASE
|
||||||
|
if ( m_bDisableFlashlight )
|
||||||
|
return false;
|
||||||
|
#endif
|
||||||
|
|
||||||
if( flags & SHADOW_FLAGS_FLASHLIGHT )
|
if( flags & SHADOW_FLAGS_FLASHLIGHT )
|
||||||
{
|
{
|
||||||
if ( GetRenderMode() > kRenderNormal && GetRenderColor().a == 0 )
|
if ( GetRenderMode() > kRenderNormal && GetRenderColor().a == 0 )
|
||||||
|
@ -1378,6 +1378,7 @@ public:
|
|||||||
|
|
||||||
#ifdef MAPBASE
|
#ifdef MAPBASE
|
||||||
int m_iViewHideFlags;
|
int m_iViewHideFlags;
|
||||||
|
bool m_bDisableFlashlight;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -284,6 +284,7 @@ IMPLEMENT_SERVERCLASS_ST_NOBASE( CBaseEntity, DT_BaseEntity )
|
|||||||
#ifdef MAPBASE
|
#ifdef MAPBASE
|
||||||
// Keep consistent with VIEW_ID_COUNT in viewrender.h
|
// Keep consistent with VIEW_ID_COUNT in viewrender.h
|
||||||
SendPropInt (SENDINFO(m_iViewHideFlags), 9, SPROP_UNSIGNED ),
|
SendPropInt (SENDINFO(m_iViewHideFlags), 9, SPROP_UNSIGNED ),
|
||||||
|
SendPropBool (SENDINFO(m_bDisableFlashlight) ),
|
||||||
#endif
|
#endif
|
||||||
SendPropInt (SENDINFO(m_iTeamNum), TEAMNUM_NUM_BITS, 0),
|
SendPropInt (SENDINFO(m_iTeamNum), TEAMNUM_NUM_BITS, 0),
|
||||||
SendPropInt (SENDINFO(m_CollisionGroup), 5, SPROP_UNSIGNED),
|
SendPropInt (SENDINFO(m_CollisionGroup), 5, SPROP_UNSIGNED),
|
||||||
@ -1915,6 +1916,7 @@ BEGIN_DATADESC_NO_BASE( CBaseEntity )
|
|||||||
DEFINE_GLOBAL_KEYFIELD( m_nModelIndex, FIELD_SHORT, "modelindex" ),
|
DEFINE_GLOBAL_KEYFIELD( m_nModelIndex, FIELD_SHORT, "modelindex" ),
|
||||||
#ifdef MAPBASE
|
#ifdef MAPBASE
|
||||||
DEFINE_KEYFIELD( m_iViewHideFlags, FIELD_INTEGER, "viewhideflags" ),
|
DEFINE_KEYFIELD( m_iViewHideFlags, FIELD_INTEGER, "viewhideflags" ),
|
||||||
|
DEFINE_KEYFIELD( m_bDisableFlashlight, FIELD_BOOLEAN, "disableflashlight" ),
|
||||||
#endif
|
#endif
|
||||||
#if !defined( NO_ENTITY_PREDICTION )
|
#if !defined( NO_ENTITY_PREDICTION )
|
||||||
// DEFINE_FIELD( m_PredictableID, CPredictableId ),
|
// DEFINE_FIELD( m_PredictableID, CPredictableId ),
|
||||||
@ -2148,6 +2150,8 @@ BEGIN_DATADESC_NO_BASE( CBaseEntity )
|
|||||||
DEFINE_INPUTFUNC( FIELD_INTEGER, "RemoveEffects", InputRemoveEffects ),
|
DEFINE_INPUTFUNC( FIELD_INTEGER, "RemoveEffects", InputRemoveEffects ),
|
||||||
DEFINE_INPUTFUNC( FIELD_VOID, "EnableDraw", InputDrawEntity ),
|
DEFINE_INPUTFUNC( FIELD_VOID, "EnableDraw", InputDrawEntity ),
|
||||||
DEFINE_INPUTFUNC( FIELD_VOID, "DisableDraw", InputUndrawEntity ),
|
DEFINE_INPUTFUNC( FIELD_VOID, "DisableDraw", InputUndrawEntity ),
|
||||||
|
DEFINE_INPUTFUNC( FIELD_VOID, "EnableReceivingFlashlight", InputEnableReceivingFlashlight ),
|
||||||
|
DEFINE_INPUTFUNC( FIELD_VOID, "DisableReceivingFlashlight", InputDisableReceivingFlashlight ),
|
||||||
DEFINE_INPUTFUNC( FIELD_INTEGER, "AddEFlags", InputAddEFlags ),
|
DEFINE_INPUTFUNC( FIELD_INTEGER, "AddEFlags", InputAddEFlags ),
|
||||||
DEFINE_INPUTFUNC( FIELD_INTEGER, "RemoveEFlags", InputRemoveEFlags ),
|
DEFINE_INPUTFUNC( FIELD_INTEGER, "RemoveEFlags", InputRemoveEFlags ),
|
||||||
DEFINE_INPUTFUNC( FIELD_INTEGER, "AddSolidFlags", InputAddSolidFlags ),
|
DEFINE_INPUTFUNC( FIELD_INTEGER, "AddSolidFlags", InputAddSolidFlags ),
|
||||||
@ -8264,6 +8268,22 @@ void CBaseEntity::InputUndrawEntity( inputdata_t& inputdata )
|
|||||||
AddEffects(EF_NODRAW);
|
AddEffects(EF_NODRAW);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
// Purpose: Inspired by the Portal 2 input of the same name.
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
void CBaseEntity::InputEnableReceivingFlashlight( inputdata_t& inputdata )
|
||||||
|
{
|
||||||
|
m_bDisableFlashlight = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
// Purpose: Inspired by the Portal 2 input of the same name.
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
void CBaseEntity::InputDisableReceivingFlashlight( inputdata_t& inputdata )
|
||||||
|
{
|
||||||
|
m_bDisableFlashlight = true;
|
||||||
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// Purpose: Adds eflags.
|
// Purpose: Adds eflags.
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
@ -762,6 +762,8 @@ public:
|
|||||||
void InputRemoveEffects( inputdata_t &inputdata );
|
void InputRemoveEffects( inputdata_t &inputdata );
|
||||||
void InputDrawEntity( inputdata_t &inputdata );
|
void InputDrawEntity( inputdata_t &inputdata );
|
||||||
void InputUndrawEntity( inputdata_t &inputdata );
|
void InputUndrawEntity( inputdata_t &inputdata );
|
||||||
|
void InputEnableReceivingFlashlight( inputdata_t &inputdata );
|
||||||
|
void InputDisableReceivingFlashlight( inputdata_t &inputdata );
|
||||||
void InputAddEFlags( inputdata_t &inputdata );
|
void InputAddEFlags( inputdata_t &inputdata );
|
||||||
void InputRemoveEFlags( inputdata_t &inputdata );
|
void InputRemoveEFlags( inputdata_t &inputdata );
|
||||||
void InputAddSolidFlags( inputdata_t &inputdata );
|
void InputAddSolidFlags( inputdata_t &inputdata );
|
||||||
@ -928,6 +930,9 @@ public:
|
|||||||
//
|
//
|
||||||
// This was partly inspired by Underhell's keyvalue that allows entities to only render in mirrors and cameras.
|
// This was partly inspired by Underhell's keyvalue that allows entities to only render in mirrors and cameras.
|
||||||
CNetworkVar( int, m_iViewHideFlags );
|
CNetworkVar( int, m_iViewHideFlags );
|
||||||
|
|
||||||
|
// Disables receiving projected textures. Based on a keyvalue from later Source games.
|
||||||
|
CNetworkVar( bool, m_bDisableFlashlight );
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// was pev->rendercolor
|
// was pev->rendercolor
|
||||||
|
Loading…
Reference in New Issue
Block a user