Only update events on PostThink to be extra sure

This commit is contained in:
unknown 2024-09-02 05:47:52 +02:00
parent 859232b6ab
commit b9586237f1
6 changed files with 39 additions and 20 deletions

View file

@ -45,15 +45,15 @@ public:
bool IsDying( void ) { return ((m_fFlags & ANIM_LAYER_DYING) != 0); }
void Dead( void ) { m_fFlags &= ~ANIM_LAYER_DYING; }
CRangeCheckedVar< int, -1, 65535, 0 > m_nSequence;
CRangeCheckedVar< float, -2, 2, 0 > m_flPrevCycle;
CRangeCheckedVar< float, -5, 5, 0 > m_flWeight;
int m_nSequence;
float m_flPrevCycle;
float m_flWeight;
int m_nOrder;
int m_fFlags;
// used for automatic crossfades between sequence changes
CRangeCheckedVar<float, -50, 50, 1> m_flPlaybackRate;
CRangeCheckedVar<float, -2, 2, 0> m_flCycle;
float m_flPlaybackRate;
float m_flCycle;
float GetFadeout( float flCurTime );

View file

@ -339,7 +339,7 @@ void C_BaseAnimatingOverlay::DoAnimationEvents( CStudioHdr *pStudioHdr )
{
Msg( "%i (seq: %d) FE %i Normal cycle %f, prev %f ev %f (time %.3f)\n",
gpGlobals->tickcount,
m_AnimOverlay[j].m_nSequence.GetRaw(),
m_AnimOverlay[j].m_nSequence,
pevent[i].event,
pevent[i].cycle,
m_flOverlayPrevEventCycle[j],

View file

@ -2706,15 +2706,7 @@ float C_CSPlayer::GetDeathCamInterpolationTime()
bool C_CSPlayer::SetupBones( matrix3x4_t* pBoneToWorldOut, int nMaxBones, int boneMask, float currentTime )
{
// Just in case.
float oldCurtime = gpGlobals->curtime;
gpGlobals->curtime = currentTime;
auto ret = BaseClass::SetupBones( pBoneToWorldOut, nMaxBones, boneMask, currentTime );
gpGlobals->curtime = oldCurtime;
return ret;
return BaseClass::SetupBones( pBoneToWorldOut, nMaxBones, boneMask, currentTime );
}
//=============================================================================

View file

@ -13,6 +13,8 @@
// memdbgon must be the last include file in a .cpp file!!!
#include "tier0/memdbgon.h"
#include "tier3/tier3.h"
#include "vgui_controls/Controls.h"
static CPDumpPanel *g_pPDumpPanel = NULL;
@ -56,6 +58,10 @@ void CPDumpPanel::ApplySettings( KeyValues *inResourceData )
SetProportional( false );
BaseClass::ApplySettings( inResourceData );
int x, y;
vgui::surface()->GetScreenSize( x, y );
SetBounds( 0, 0, x, y );
}
void CPDumpPanel::ApplySchemeSettings( vgui::IScheme *pScheme )
@ -64,6 +70,10 @@ void CPDumpPanel::ApplySchemeSettings( vgui::IScheme *pScheme )
SetProportional( false );
SetPaintBackgroundEnabled( false );
int x, y;
vgui::surface()->GetScreenSize( x, y );
SetBounds( 0, 0, x, y );
}
//-----------------------------------------------------------------------------
@ -259,7 +269,7 @@ void CPDumpPanel::Paint()
// Now output the strings
int x[5];
x[0] = 20;
int columnwidth = 375;
int columnwidth = 500;
int numcols = ScreenWidth() / columnwidth;
int i;

View file

@ -1574,6 +1574,13 @@ void CCSPlayer::PostThink()
// Store the eye angles pitch so the client can compute its animation state correctly.
m_angEyeAngles = EyeAngles();
for (auto&& event : m_allEvents)
{
m_PlayerAnimState->DoAnimationEvent( event.m_currentWantedEvent, event.m_currentnData );
}
m_allEvents.RemoveAll();
m_PlayerAnimState->Update( m_angEyeAngles[YAW], m_angEyeAngles[PITCH] );
m_angRenderAngles = m_PlayerAnimState->GetRenderAngles();
@ -6628,7 +6635,7 @@ void CCSPlayer::DoAnimationEvent( PlayerAnimEvent_t event, int nData )
}
else
{
m_PlayerAnimState->DoAnimationEvent( event, nData );
m_allEvents.AddToTail( { event, nData } );
}
}

View file

@ -1041,9 +1041,19 @@ private:
// HPE_END
//=============================================================================
int m_iDeathFlags; // Flags holding revenge and domination info about a death
//=============================================================================
// HPE_END
//=============================================================================
// We really need to keep in sync with the server <=> client.
struct Events
{
PlayerAnimEvent_t m_currentWantedEvent;
int m_currentnData;
};
CUtlVector< Events > m_allEvents;
//=============================================================================
// HPE_END
//=============================================================================
};