mirror of
https://github.com/VCMP-SqMod/SqMod.git
synced 2025-01-31 09:57:14 +01:00
Make the audit stage optional.
Also fix bug where the execution function is not invoked without binding an audit function first which enables it.
This commit is contained in:
parent
47ff628a46
commit
cb0598d228
@ -400,6 +400,8 @@ int32_t Controller::Exec(Context & ctx)
|
|||||||
args = LightObj(arr.GetObj());
|
args = LightObj(arr.GetObj());
|
||||||
}
|
}
|
||||||
// Allow the user to audit the command parameters
|
// Allow the user to audit the command parameters
|
||||||
|
if (!ctx.mInstance->m_OnAudit.IsNull())
|
||||||
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
result = ctx.mInstance->Audit(ctx.mInvoker, args);
|
result = ctx.mInstance->Audit(ctx.mInvoker, args);
|
||||||
@ -411,6 +413,11 @@ int32_t Controller::Exec(Context & ctx)
|
|||||||
// Specify that the command execution failed
|
// Specify that the command execution failed
|
||||||
failed = true;
|
failed = true;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
result = SQTrue;
|
||||||
|
}
|
||||||
// Did parameter audit succeeded?
|
// Did parameter audit succeeded?
|
||||||
if (result && !failed)
|
if (result && !failed)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user