fix: block HUD scope animation exploit

This commit is contained in:
mastercoms 2025-02-19 04:38:04 -05:00 committed by EricS-Valve
parent 52e568b374
commit 1eba26f518
3 changed files with 7 additions and 0 deletions

View File

@ -242,6 +242,7 @@ protected:
virtual void ApplySchemeSettings(vgui::IScheme *scheme);
virtual void Paint( void );
virtual bool ShouldDraw( void );
virtual bool CanAnimate() const override { return false; };
private:
int m_iScopeTexture[4];

View File

@ -347,6 +347,8 @@ public:
bool IsRightAligned(); // returns true if the settings are aligned to the right of the screen
bool IsBottomAligned(); // returns true if the settings are aligned to the bottom of the screen
virtual bool CanAnimate() const { return true; } // If the panel can animate
// scheme access functions
virtual HScheme GetScheme();
virtual void SetScheme(const char *tag);

View File

@ -1344,6 +1344,10 @@ void AnimationController::StartCmd_Animate(UtlSymId_t seqName, AnimCmdAnimate_t
if (!panel)
return;
// Block some panels (like HudScope). Unfortunately players are abusing animations with broad/null parents.
if ( !panel->CanAnimate() )
return;
StartCmd_Animate(panel, seqName, cmd, bCanBeCancelled);
}