1
0
mirror of https://github.com/VCMP-SqMod/SqMod.git synced 2025-02-21 20:27:13 +01:00

Allow unbinding of command manager callbacks by passing null.

This commit is contained in:
Sandu Liviu Catalin 2016-08-26 16:54:23 +03:00
parent 981e16ad01
commit 46fae978d7

View File

@ -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())
{