mirror of
				https://github.com/VCMP-SqMod/SqMod.git
				synced 2025-11-04 08:17:19 +01:00 
			
		
		
		
	Allow unbinding of command manager callbacks by passing null.
This commit is contained in:
		@@ -625,8 +625,13 @@ public:
 | 
			
		||||
    */
 | 
			
		||||
    void SetOnFail(Object & env, Function & func)
 | 
			
		||||
    {
 | 
			
		||||
        // Are we supposed to unbind current callback?
 | 
			
		||||
        if (func.IsNull())
 | 
			
		||||
        {
 | 
			
		||||
            m_OnFail.ReleaseGently();
 | 
			
		||||
        }
 | 
			
		||||
        // Was there a custom environment specified?
 | 
			
		||||
        if (env.IsNull())
 | 
			
		||||
        else if (env.IsNull())
 | 
			
		||||
        {
 | 
			
		||||
            m_OnFail = func;
 | 
			
		||||
        }
 | 
			
		||||
@@ -649,6 +654,11 @@ public:
 | 
			
		||||
    */
 | 
			
		||||
    void SetOnAuth(Object & env, Function & func)
 | 
			
		||||
    {
 | 
			
		||||
        // Are we supposed to unbind current callback?
 | 
			
		||||
        if (func.IsNull())
 | 
			
		||||
        {
 | 
			
		||||
            m_OnAuth.ReleaseGently();
 | 
			
		||||
        }
 | 
			
		||||
        // Was there a custom environment specified?
 | 
			
		||||
        if (env.IsNull())
 | 
			
		||||
        {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user