mirror of
https://github.com/celisej567/source-engine.git
synced 2025-12-31 21:48:22 +03:00
Compare commits
2 Commits
lower_fix
...
text_selec
| Author | SHA1 | Date | |
|---|---|---|---|
| 32a8141504 | |||
|
|
ed8209cc35 |
@@ -151,7 +151,7 @@ InitReturnVal_t CDataModel::Init( )
|
||||
//#define _ELEMENT_HISTOGRAM_
|
||||
#ifdef _ELEMENT_HISTOGRAM_
|
||||
CUtlMap< UtlSymId_t, int > g_typeHistogram( 0, 100, DefLessFunc( UtlSymId_t ) );
|
||||
#endif _ELEMENT_HISTOGRAM_
|
||||
#endif //_ELEMENT_HISTOGRAM_
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
@@ -166,7 +166,7 @@ void CDataModel::Shutdown()
|
||||
Msg( "%d\t%s\n", g_typeHistogram.Element( i ), GetString( g_typeHistogram.Key( i ) ) );
|
||||
}
|
||||
Msg( "\n" );
|
||||
#endif _ELEMENT_HISTOGRAM_
|
||||
#endif //_ELEMENT_HISTOGRAM_
|
||||
|
||||
int c = GetAllocatedElementCount();
|
||||
if ( c > 0 )
|
||||
@@ -1934,7 +1934,7 @@ CDmElement* CDataModel::CreateElement( const DmElementReference_t &ref, const ch
|
||||
{
|
||||
g_typeHistogram.Insert( typeSym, 1 );
|
||||
}
|
||||
#endif _ELEMENT_HISTOGRAM_
|
||||
#endif //_ELEMENT_HISTOGRAM_
|
||||
}
|
||||
|
||||
return pElement;
|
||||
|
||||
@@ -552,9 +552,9 @@ void CWeaponShotgun::SecondaryAttack( void )
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Override so shotgun can do mulitple reloads in a row
|
||||
//-----------------------------------------------------------------------------
|
||||
void CWeaponShotgun::ItemPostFrame(void)
|
||||
void CWeaponShotgun::ItemPostFrame( void )
|
||||
{
|
||||
CBasePlayer* pOwner = ToBasePlayer(GetOwner());
|
||||
CBasePlayer *pOwner = ToBasePlayer( GetOwner() );
|
||||
if (!pOwner)
|
||||
{
|
||||
return;
|
||||
@@ -563,23 +563,23 @@ void CWeaponShotgun::ItemPostFrame(void)
|
||||
if (m_bInReload)
|
||||
{
|
||||
// If I'm primary firing and have one round stop reloading and fire
|
||||
if ((pOwner->m_nButtons & IN_ATTACK) && (m_iClip1 >= 1))
|
||||
if ((pOwner->m_nButtons & IN_ATTACK ) && (m_iClip1 >=1))
|
||||
{
|
||||
m_bInReload = false;
|
||||
m_bNeedPump = false;
|
||||
m_bInReload = false;
|
||||
m_bNeedPump = false;
|
||||
m_bDelayedFire1 = true;
|
||||
}
|
||||
// If I'm secondary firing and have one round stop reloading and fire
|
||||
else if ((pOwner->m_nButtons & IN_ATTACK2) && (m_iClip1 >= 2))
|
||||
else if ((pOwner->m_nButtons & IN_ATTACK2 ) && (m_iClip1 >=2))
|
||||
{
|
||||
m_bInReload = false;
|
||||
m_bNeedPump = false;
|
||||
m_bInReload = false;
|
||||
m_bNeedPump = false;
|
||||
m_bDelayedFire2 = true;
|
||||
}
|
||||
else if (m_flNextPrimaryAttack <= gpGlobals->curtime)
|
||||
{
|
||||
// If out of ammo end reload
|
||||
if (pOwner->GetAmmoCount(m_iPrimaryAmmoType) <= 0)
|
||||
if (pOwner->GetAmmoCount(m_iPrimaryAmmoType) <=0)
|
||||
{
|
||||
FinishReload();
|
||||
return;
|
||||
@@ -599,9 +599,9 @@ void CWeaponShotgun::ItemPostFrame(void)
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
{
|
||||
// Make shotgun shell invisible
|
||||
SetBodygroup(1, 1);
|
||||
SetBodygroup(1,1);
|
||||
}
|
||||
|
||||
if ((m_bNeedPump) && (m_flNextPrimaryAttack <= gpGlobals->curtime))
|
||||
@@ -609,87 +609,78 @@ void CWeaponShotgun::ItemPostFrame(void)
|
||||
Pump();
|
||||
return;
|
||||
}
|
||||
|
||||
#ifdef GAME_DLL
|
||||
if (!m_bLowered)
|
||||
|
||||
// Shotgun uses same timing and ammo for secondary attack
|
||||
if ((m_bDelayedFire2 || pOwner->m_nButtons & IN_ATTACK2)&&(m_flNextPrimaryAttack <= gpGlobals->curtime))
|
||||
{
|
||||
#endif // GAME_DLL
|
||||
|
||||
|
||||
// Shotgun uses same timing and ammo for secondary attack
|
||||
if ((m_bDelayedFire2 || pOwner->m_nButtons & IN_ATTACK2) && (m_flNextPrimaryAttack <= gpGlobals->curtime))
|
||||
m_bDelayedFire2 = false;
|
||||
|
||||
if ( (m_iClip1 <= 1 && UsesClipsForAmmo1()))
|
||||
{
|
||||
m_bDelayedFire2 = false;
|
||||
|
||||
if ((m_iClip1 <= 1 && UsesClipsForAmmo1()))
|
||||
// If only one shell is left, do a single shot instead
|
||||
if ( m_iClip1 == 1 )
|
||||
{
|
||||
// If only one shell is left, do a single shot instead
|
||||
if (m_iClip1 == 1)
|
||||
{
|
||||
PrimaryAttack();
|
||||
}
|
||||
else if (!pOwner->GetAmmoCount(m_iPrimaryAmmoType))
|
||||
{
|
||||
DryFire();
|
||||
}
|
||||
else
|
||||
{
|
||||
StartReload();
|
||||
}
|
||||
}
|
||||
|
||||
// Fire underwater?
|
||||
else if (GetOwner()->GetWaterLevel() == 3 && m_bFiresUnderwater == false)
|
||||
{
|
||||
WeaponSound(EMPTY);
|
||||
m_flNextPrimaryAttack = gpGlobals->curtime + 0.2;
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
// If the firing button was just pressed, reset the firing time
|
||||
if (pOwner->m_afButtonPressed & IN_ATTACK)
|
||||
{
|
||||
m_flNextPrimaryAttack = gpGlobals->curtime;
|
||||
}
|
||||
SecondaryAttack();
|
||||
}
|
||||
}
|
||||
else if ((m_bDelayedFire1 || pOwner->m_nButtons & IN_ATTACK) && m_flNextPrimaryAttack <= gpGlobals->curtime)
|
||||
{
|
||||
m_bDelayedFire1 = false;
|
||||
if ((m_iClip1 <= 0 && UsesClipsForAmmo1()) || (!UsesClipsForAmmo1() && !pOwner->GetAmmoCount(m_iPrimaryAmmoType)))
|
||||
{
|
||||
if (!pOwner->GetAmmoCount(m_iPrimaryAmmoType))
|
||||
{
|
||||
DryFire();
|
||||
}
|
||||
else
|
||||
{
|
||||
StartReload();
|
||||
}
|
||||
}
|
||||
// Fire underwater?
|
||||
else if (pOwner->GetWaterLevel() == 3 && m_bFiresUnderwater == false)
|
||||
{
|
||||
WeaponSound(EMPTY);
|
||||
m_flNextPrimaryAttack = gpGlobals->curtime + 0.2;
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
// If the firing button was just pressed, reset the firing time
|
||||
CBasePlayer* pPlayer = ToBasePlayer(GetOwner());
|
||||
if (pPlayer && pPlayer->m_afButtonPressed & IN_ATTACK)
|
||||
{
|
||||
m_flNextPrimaryAttack = gpGlobals->curtime;
|
||||
}
|
||||
PrimaryAttack();
|
||||
}
|
||||
else if (!pOwner->GetAmmoCount(m_iPrimaryAmmoType))
|
||||
{
|
||||
DryFire();
|
||||
}
|
||||
else
|
||||
{
|
||||
StartReload();
|
||||
}
|
||||
}
|
||||
|
||||
// Fire underwater?
|
||||
else if (GetOwner()->GetWaterLevel() == 3 && m_bFiresUnderwater == false)
|
||||
{
|
||||
WeaponSound(EMPTY);
|
||||
m_flNextPrimaryAttack = gpGlobals->curtime + 0.2;
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
// If the firing button was just pressed, reset the firing time
|
||||
if ( pOwner->m_afButtonPressed & IN_ATTACK )
|
||||
{
|
||||
m_flNextPrimaryAttack = gpGlobals->curtime;
|
||||
}
|
||||
SecondaryAttack();
|
||||
}
|
||||
}
|
||||
else if ( (m_bDelayedFire1 || pOwner->m_nButtons & IN_ATTACK) && m_flNextPrimaryAttack <= gpGlobals->curtime)
|
||||
{
|
||||
m_bDelayedFire1 = false;
|
||||
if ( (m_iClip1 <= 0 && UsesClipsForAmmo1()) || ( !UsesClipsForAmmo1() && !pOwner->GetAmmoCount(m_iPrimaryAmmoType) ) )
|
||||
{
|
||||
if (!pOwner->GetAmmoCount(m_iPrimaryAmmoType))
|
||||
{
|
||||
DryFire();
|
||||
}
|
||||
else
|
||||
{
|
||||
StartReload();
|
||||
}
|
||||
}
|
||||
// Fire underwater?
|
||||
else if (pOwner->GetWaterLevel() == 3 && m_bFiresUnderwater == false)
|
||||
{
|
||||
WeaponSound(EMPTY);
|
||||
m_flNextPrimaryAttack = gpGlobals->curtime + 0.2;
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
// If the firing button was just pressed, reset the firing time
|
||||
CBasePlayer *pPlayer = ToBasePlayer( GetOwner() );
|
||||
if ( pPlayer && pPlayer->m_afButtonPressed & IN_ATTACK )
|
||||
{
|
||||
m_flNextPrimaryAttack = gpGlobals->curtime;
|
||||
}
|
||||
PrimaryAttack();
|
||||
}
|
||||
#ifdef GAME_DLL
|
||||
}
|
||||
#endif // GAME_DLL
|
||||
|
||||
if ( pOwner->m_nButtons & IN_RELOAD && UsesClipsForAmmo1() && !m_bInReload )
|
||||
{
|
||||
|
||||
@@ -94,11 +94,6 @@ CBaseCombatWeapon::CBaseCombatWeapon() : BASECOMBATWEAPON_DERIVED_FROM()
|
||||
|
||||
m_hWeaponFileInfo = GetInvalidWeaponInfoHandle();
|
||||
|
||||
#ifdef GAME_DLL
|
||||
m_bLowered = false;
|
||||
m_flRaiseTime = gpGlobals->curtime;
|
||||
#endif
|
||||
|
||||
#if defined( TF_DLL )
|
||||
UseClientSideAnimation();
|
||||
#endif
|
||||
@@ -1652,127 +1647,118 @@ void CBaseCombatWeapon::ItemPreFrame( void )
|
||||
//====================================================================================
|
||||
// WEAPON BEHAVIOUR
|
||||
//====================================================================================
|
||||
void CBaseCombatWeapon::ItemPostFrame(void)
|
||||
void CBaseCombatWeapon::ItemPostFrame( void )
|
||||
{
|
||||
CBasePlayer* pOwner = ToBasePlayer(GetOwner());
|
||||
CBasePlayer *pOwner = ToBasePlayer( GetOwner() );
|
||||
if (!pOwner)
|
||||
return;
|
||||
|
||||
|
||||
UpdateAutoFire();
|
||||
|
||||
//Track the duration of the fire
|
||||
//FIXME: Check for IN_ATTACK2 as well?
|
||||
//FIXME: What if we're calling ItemBusyFrame?
|
||||
m_fFireDuration = (pOwner->m_nButtons & IN_ATTACK) ? (m_fFireDuration + gpGlobals->frametime) : 0.0f;
|
||||
m_fFireDuration = ( pOwner->m_nButtons & IN_ATTACK ) ? ( m_fFireDuration + gpGlobals->frametime ) : 0.0f;
|
||||
|
||||
if (UsesClipsForAmmo1())
|
||||
if ( UsesClipsForAmmo1() )
|
||||
{
|
||||
CheckReload();
|
||||
}
|
||||
|
||||
bool bFired = false;
|
||||
#ifdef GAME_DLL
|
||||
if (!m_bLowered)
|
||||
|
||||
// Secondary attack has priority
|
||||
if ((pOwner->m_nButtons & IN_ATTACK2) && (m_flNextSecondaryAttack <= gpGlobals->curtime))
|
||||
{
|
||||
#endif
|
||||
// Secondary attack has priority
|
||||
if ((pOwner->m_nButtons & IN_ATTACK2) && (m_flNextSecondaryAttack <= gpGlobals->curtime))
|
||||
if (UsesSecondaryAmmo() && pOwner->GetAmmoCount(m_iSecondaryAmmoType)<=0 )
|
||||
{
|
||||
if (UsesSecondaryAmmo() && pOwner->GetAmmoCount(m_iSecondaryAmmoType) <= 0)
|
||||
if (m_flNextEmptySoundTime < gpGlobals->curtime)
|
||||
{
|
||||
if (m_flNextEmptySoundTime < gpGlobals->curtime)
|
||||
{
|
||||
WeaponSound(EMPTY);
|
||||
m_flNextSecondaryAttack = m_flNextEmptySoundTime = gpGlobals->curtime + 0.5;
|
||||
}
|
||||
}
|
||||
else if (pOwner->GetWaterLevel() == 3 && m_bAltFiresUnderwater == false)
|
||||
{
|
||||
// This weapon doesn't fire underwater
|
||||
WeaponSound(EMPTY);
|
||||
m_flNextPrimaryAttack = gpGlobals->curtime + 0.2;
|
||||
return;
|
||||
m_flNextSecondaryAttack = m_flNextEmptySoundTime = gpGlobals->curtime + 0.5;
|
||||
}
|
||||
else
|
||||
{
|
||||
// FIXME: This isn't necessarily true if the weapon doesn't have a secondary fire!
|
||||
// For instance, the crossbow doesn't have a 'real' secondary fire, but it still
|
||||
// stops the crossbow from firing on the 360 if the player chooses to hold down their
|
||||
// zoom button. (sjb) Orange Box 7/25/2007
|
||||
}
|
||||
else if (pOwner->GetWaterLevel() == 3 && m_bAltFiresUnderwater == false)
|
||||
{
|
||||
// This weapon doesn't fire underwater
|
||||
WeaponSound(EMPTY);
|
||||
m_flNextPrimaryAttack = gpGlobals->curtime + 0.2;
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
// FIXME: This isn't necessarily true if the weapon doesn't have a secondary fire!
|
||||
// For instance, the crossbow doesn't have a 'real' secondary fire, but it still
|
||||
// stops the crossbow from firing on the 360 if the player chooses to hold down their
|
||||
// zoom button. (sjb) Orange Box 7/25/2007
|
||||
#if !defined(CLIENT_DLL)
|
||||
if (!IsX360() || !ClassMatches("weapon_crossbow"))
|
||||
if( !IsX360() || !ClassMatches("weapon_crossbow") )
|
||||
#endif
|
||||
{
|
||||
bFired = ShouldBlockPrimaryFire();
|
||||
}
|
||||
{
|
||||
bFired = ShouldBlockPrimaryFire();
|
||||
}
|
||||
|
||||
SecondaryAttack();
|
||||
SecondaryAttack();
|
||||
|
||||
// Secondary ammo doesn't have a reload animation
|
||||
if (UsesClipsForAmmo2())
|
||||
// Secondary ammo doesn't have a reload animation
|
||||
if ( UsesClipsForAmmo2() )
|
||||
{
|
||||
// reload clip2 if empty
|
||||
if (m_iClip2 < 1)
|
||||
{
|
||||
// reload clip2 if empty
|
||||
if (m_iClip2 < 1)
|
||||
{
|
||||
pOwner->RemoveAmmo(1, m_iSecondaryAmmoType);
|
||||
m_iClip2 = m_iClip2 + 1;
|
||||
}
|
||||
pOwner->RemoveAmmo( 1, m_iSecondaryAmmoType );
|
||||
m_iClip2 = m_iClip2 + 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!bFired && (pOwner->m_nButtons & IN_ATTACK) && (m_flNextPrimaryAttack <= gpGlobals->curtime))
|
||||
}
|
||||
|
||||
if ( !bFired && (pOwner->m_nButtons & IN_ATTACK) && (m_flNextPrimaryAttack <= gpGlobals->curtime))
|
||||
{
|
||||
// Clip empty? Or out of ammo on a no-clip weapon?
|
||||
if ( !IsMeleeWeapon() &&
|
||||
(( UsesClipsForAmmo1() && m_iClip1 <= 0) || ( !UsesClipsForAmmo1() && pOwner->GetAmmoCount(m_iPrimaryAmmoType)<=0 )) )
|
||||
{
|
||||
// Clip empty? Or out of ammo on a no-clip weapon?
|
||||
if (!IsMeleeWeapon() &&
|
||||
((UsesClipsForAmmo1() && m_iClip1 <= 0) || (!UsesClipsForAmmo1() && pOwner->GetAmmoCount(m_iPrimaryAmmoType) <= 0)))
|
||||
HandleFireOnEmpty();
|
||||
}
|
||||
else if (pOwner->GetWaterLevel() == 3 && m_bFiresUnderwater == false)
|
||||
{
|
||||
// This weapon doesn't fire underwater
|
||||
WeaponSound(EMPTY);
|
||||
m_flNextPrimaryAttack = gpGlobals->curtime + 0.2;
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
//NOTENOTE: There is a bug with this code with regards to the way machine guns catch the leading edge trigger
|
||||
// on the player hitting the attack key. It relies on the gun catching that case in the same frame.
|
||||
// However, because the player can also be doing a secondary attack, the edge trigger may be missed.
|
||||
// We really need to hold onto the edge trigger and only clear the condition when the gun has fired its
|
||||
// first shot. Right now that's too much of an architecture change -- jdw
|
||||
|
||||
// If the firing button was just pressed, or the alt-fire just released, reset the firing time
|
||||
if ( ( pOwner->m_afButtonPressed & IN_ATTACK ) || ( pOwner->m_afButtonReleased & IN_ATTACK2 ) )
|
||||
{
|
||||
HandleFireOnEmpty();
|
||||
m_flNextPrimaryAttack = gpGlobals->curtime;
|
||||
}
|
||||
else if (pOwner->GetWaterLevel() == 3 && m_bFiresUnderwater == false)
|
||||
|
||||
PrimaryAttack();
|
||||
|
||||
if ( AutoFiresFullClip() )
|
||||
{
|
||||
// This weapon doesn't fire underwater
|
||||
WeaponSound(EMPTY);
|
||||
m_flNextPrimaryAttack = gpGlobals->curtime + 0.2;
|
||||
return;
|
||||
m_bFiringWholeClip = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
//NOTENOTE: There is a bug with this code with regards to the way machine guns catch the leading edge trigger
|
||||
// on the player hitting the attack key. It relies on the gun catching that case in the same frame.
|
||||
// However, because the player can also be doing a secondary attack, the edge trigger may be missed.
|
||||
// We really need to hold onto the edge trigger and only clear the condition when the gun has fired its
|
||||
// first shot. Right now that's too much of an architecture change -- jdw
|
||||
|
||||
// If the firing button was just pressed, or the alt-fire just released, reset the firing time
|
||||
if ((pOwner->m_afButtonPressed & IN_ATTACK) || (pOwner->m_afButtonReleased & IN_ATTACK2))
|
||||
{
|
||||
m_flNextPrimaryAttack = gpGlobals->curtime;
|
||||
}
|
||||
|
||||
PrimaryAttack();
|
||||
|
||||
if (AutoFiresFullClip())
|
||||
{
|
||||
m_bFiringWholeClip = true;
|
||||
}
|
||||
|
||||
#ifdef CLIENT_DLL
|
||||
pOwner->SetFiredWeapon(true);
|
||||
pOwner->SetFiredWeapon( true );
|
||||
#endif
|
||||
}
|
||||
}
|
||||
#ifdef GAME_DLL
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
// -----------------------
|
||||
// Reload pressed / Clip Empty
|
||||
// -----------------------
|
||||
if ((pOwner->m_nButtons & IN_RELOAD) && UsesClipsForAmmo1() && !m_bInReload)
|
||||
if ( ( pOwner->m_nButtons & IN_RELOAD ) && UsesClipsForAmmo1() && !m_bInReload )
|
||||
{
|
||||
// reload when reload is pressed, or if no buttons are down and weapon is empty.
|
||||
Reload();
|
||||
@@ -1785,7 +1771,7 @@ void CBaseCombatWeapon::ItemPostFrame(void)
|
||||
if (!((pOwner->m_nButtons & IN_ATTACK) || (pOwner->m_nButtons & IN_ATTACK2) || (CanReload() && pOwner->m_nButtons & IN_RELOAD)))
|
||||
{
|
||||
// no fire buttons down or reloading
|
||||
if (!ReloadOrSwitchWeapons() && (m_bInReload == false))
|
||||
if ( !ReloadOrSwitchWeapons() && ( m_bInReload == false ) )
|
||||
{
|
||||
WeaponIdle();
|
||||
}
|
||||
@@ -2593,9 +2579,6 @@ IMPLEMENT_NETWORKCLASS_ALIASED( BaseCombatWeapon, DT_BaseCombatWeapon )
|
||||
//-----------------------------------------------------------------------------//
|
||||
BEGIN_DATADESC( CBaseCombatWeapon )
|
||||
|
||||
DEFINE_FIELD(m_bLowered, FIELD_BOOLEAN),
|
||||
DEFINE_FIELD(m_flRaiseTime, FIELD_TIME),
|
||||
|
||||
DEFINE_FIELD( m_flNextPrimaryAttack, FIELD_TIME ),
|
||||
DEFINE_FIELD( m_flNextSecondaryAttack, FIELD_TIME ),
|
||||
DEFINE_FIELD( m_flTimeWeaponIdle, FIELD_TIME ),
|
||||
|
||||
@@ -526,11 +526,6 @@ private:
|
||||
CNetworkVar( CBaseCombatCharacterHandle, m_hOwner ); // Player carrying this weapon
|
||||
|
||||
protected:
|
||||
#ifdef GAME_DLL
|
||||
bool m_bLowered; // Whether the viewmodel is raised or lowered
|
||||
float m_flRaiseTime; // If lowered, the time we should raise the viewmodel
|
||||
#endif
|
||||
|
||||
#if defined ( TF_CLIENT_DLL ) || defined ( TF_DLL )
|
||||
// Regulate crit frequency to reduce client-side seed hacking
|
||||
void AddToCritBucket( float flAmount );
|
||||
|
||||
@@ -34,6 +34,8 @@ END_NETWORK_TABLE()
|
||||
//---------------------------------------------------------
|
||||
BEGIN_DATADESC( CBaseHLCombatWeapon )
|
||||
|
||||
DEFINE_FIELD( m_bLowered, FIELD_BOOLEAN ),
|
||||
DEFINE_FIELD( m_flRaiseTime, FIELD_TIME ),
|
||||
DEFINE_FIELD( m_flHolsterTime, FIELD_TIME ),
|
||||
DEFINE_FIELD( m_iPrimaryAttacks, FIELD_INTEGER ),
|
||||
DEFINE_FIELD( m_iSecondaryAttacks, FIELD_INTEGER ),
|
||||
|
||||
@@ -58,10 +58,8 @@ public:
|
||||
|
||||
protected:
|
||||
|
||||
#ifndef GAME_DLL
|
||||
bool m_bLowered; // Whether the viewmodel is raised or lowered
|
||||
float m_flRaiseTime; // If lowered, the time we should raise the viewmodel
|
||||
#endif
|
||||
float m_flHolsterTime; // When the weapon was holstered
|
||||
};
|
||||
|
||||
|
||||
@@ -92,7 +92,7 @@ public:
|
||||
void Init( CDmElement *pOwner, const char *pAttributeName, int flags = 0 );
|
||||
|
||||
// Returns the type of elements allowed into this attribute. UTL_INVAL_SYMBOL allows everything.
|
||||
UtlSymId_t GetElementType() const;
|
||||
//UtlSymId_t GetElementType() const;
|
||||
|
||||
// Get/set
|
||||
void Set( T* pElement );
|
||||
@@ -1149,11 +1149,13 @@ inline void CDmaElement<T>::Init( CDmElement *pOwner, const char *pAttributeName
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
template <class T>
|
||||
inline UtlSymId_t CDmaElement<T>::GetElementType() const
|
||||
{
|
||||
return this->Data().m_ElementType;
|
||||
}
|
||||
*/
|
||||
|
||||
template <class T>
|
||||
inline T* CDmaElement<T>::GetElement() const
|
||||
|
||||
@@ -109,8 +109,8 @@ protected:
|
||||
|
||||
T** m_pMemory;
|
||||
int m_nBlocks;
|
||||
int m_nIndexMask : 27;
|
||||
int m_nIndexShift : 5;
|
||||
int m_nIndexMask;
|
||||
int m_nIndexShift;
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
@@ -130,17 +130,16 @@ CUtlBlockMemory<T,I>::~CUtlBlockMemory()
|
||||
Purge();
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Fast swap
|
||||
//-----------------------------------------------------------------------------
|
||||
template< class T, class I >
|
||||
void CUtlBlockMemory<T,I>::Swap( CUtlBlockMemory< T, I > &mem )
|
||||
{
|
||||
this->swap( m_pMemory, mem.m_pMemory );
|
||||
this->swap( m_nBlocks, mem.m_nBlocks );
|
||||
this->swap( m_nIndexMask, mem.m_nIndexMask );
|
||||
this->swap( m_nIndexShift, mem.m_nIndexShift );
|
||||
V_swap( m_pMemory, mem.m_pMemory );
|
||||
V_swap( m_nBlocks, mem.m_nBlocks );
|
||||
V_swap( m_nIndexMask, mem.m_nIndexMask );
|
||||
V_swap( m_nIndexShift, mem.m_nIndexShift );
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -862,6 +862,12 @@ void RichText::Paint()
|
||||
if ( m_LineBreaks.IsValidIndex( lineBreakIndexIndex ) && m_LineBreaks[lineBreakIndexIndex] < iLim )
|
||||
iLim = m_LineBreaks[lineBreakIndexIndex];
|
||||
|
||||
// Stop when entering or exiting the selected range
|
||||
if ( i < selection0 && iLim >= selection0 )
|
||||
iLim = selection0;
|
||||
if ( i >= selection0 && i < selection1 && iLim >= selection1 )
|
||||
iLim = selection1;
|
||||
|
||||
// Handle non-drawing characters specially
|
||||
for ( int iT = i; iT < iLim; iT++ )
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user