mirror of
https://github.com/ValveSoftware/source-sdk-2013.git
synced 2025-05-10 22:09:29 +03:00
fix: block HUD scope animation exploit
This commit is contained in:
parent
52e568b374
commit
1eba26f518
@ -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];
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user