mirror of
				https://github.com/VCMP-SqMod/SqMod.git
				synced 2025-11-04 08:17:19 +01:00 
			
		
		
		
	Allow unbinding of command listener callbacks by passing null.
This commit is contained in:
		@@ -1649,6 +1649,11 @@ public:
 | 
			
		||||
        {
 | 
			
		||||
            STHROWF("Detached commands cannot store script resources");
 | 
			
		||||
        }
 | 
			
		||||
        // Are we supposed to unbind current callback?
 | 
			
		||||
        else if (func.IsNull())
 | 
			
		||||
        {
 | 
			
		||||
            m_OnExec.ReleaseGently();
 | 
			
		||||
        }
 | 
			
		||||
        // Was there a custom environment specified?
 | 
			
		||||
        else if (env.IsNull())
 | 
			
		||||
        {
 | 
			
		||||
@@ -1678,6 +1683,11 @@ public:
 | 
			
		||||
        {
 | 
			
		||||
            STHROWF("Detached commands cannot store script resources");
 | 
			
		||||
        }
 | 
			
		||||
        // Are we supposed to unbind current callback?
 | 
			
		||||
        else if (func.IsNull())
 | 
			
		||||
        {
 | 
			
		||||
            m_OnAuth.ReleaseGently();
 | 
			
		||||
        }
 | 
			
		||||
        // Was there a custom environment specified?
 | 
			
		||||
        else if (env.IsNull())
 | 
			
		||||
        {
 | 
			
		||||
@@ -1707,6 +1717,11 @@ public:
 | 
			
		||||
        {
 | 
			
		||||
            STHROWF("Detached listeners cannot store script resources");
 | 
			
		||||
        }
 | 
			
		||||
        // Are we supposed to unbind current callback?
 | 
			
		||||
        else if (func.IsNull())
 | 
			
		||||
        {
 | 
			
		||||
            m_OnPost.ReleaseGently();
 | 
			
		||||
        }
 | 
			
		||||
        // Was there a custom environment specified?
 | 
			
		||||
        else if (env.IsNull())
 | 
			
		||||
        {
 | 
			
		||||
@@ -1736,6 +1751,11 @@ public:
 | 
			
		||||
        {
 | 
			
		||||
            STHROWF("Detached listeners cannot store script resources");
 | 
			
		||||
        }
 | 
			
		||||
        // Are we supposed to unbind current callback?
 | 
			
		||||
        else if (func.IsNull())
 | 
			
		||||
        {
 | 
			
		||||
            m_OnFail.ReleaseGently();
 | 
			
		||||
        }
 | 
			
		||||
        // Was there a custom environment specified?
 | 
			
		||||
        else if (env.IsNull())
 | 
			
		||||
        {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user