mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-01-19 20:24:49 +00:00
enhanced argc reporting
in a method argc out of bounds scenario, report how many it got, and what range it expected
This commit is contained in:
parent
0f32ae256e
commit
1ea74bf8c6
|
|
@ -1173,7 +1173,7 @@ ConsoleValue Namespace::Entry::execute(S32 argc, ConsoleValue *argv, SimObject *
|
|||
|
||||
if ((mMinArgs && argc < mMinArgs) || (mMaxArgs && argc > mMaxArgs))
|
||||
{
|
||||
Con::warnf(ConsoleLogEntry::Script, "%s::%s - wrong number of arguments.", mNamespace->mName, mFunctionName);
|
||||
Con::warnf(ConsoleLogEntry::Script, "%s::%s - wrong number of arguments. got %d, expected %d to %d", mNamespace->mName, mFunctionName, argc, mMinArgs, mMaxArgs);
|
||||
Con::warnf(ConsoleLogEntry::Script, "usage: %s", mUsage);
|
||||
return std::move(ConsoleValue());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1909,7 +1909,7 @@ Con::EvalResult CodeBlock::exec(U32 ip, const char* functionName, Namespace* thi
|
|||
if ((nsEntry->mMinArgs && S32(callArgc) < nsEntry->mMinArgs) || (nsEntry->mMaxArgs && S32(callArgc) > nsEntry->mMaxArgs))
|
||||
{
|
||||
const char* nsName = ns ? ns->mName : "";
|
||||
Con::warnf(ConsoleLogEntry::Script, "%s: %s::%s - wrong number of arguments.", getFileLine(ip - 4), nsName, fnName);
|
||||
Con::warnf(ConsoleLogEntry::Script, "%s: %s::%s - wrong number of arguments. got %d, expected %d to %d", getFileLine(ip - 4), nsName, fnName, S32(callArgc), nsEntry->mMinArgs, nsEntry->mMaxArgs);
|
||||
Con::warnf(ConsoleLogEntry::Script, "%s: usage: %s", getFileLine(ip - 4), nsEntry->mUsage);
|
||||
gCallStack.popFrame();
|
||||
stack[_STK + 1].setEmptyString();
|
||||
|
|
|
|||
Loading…
Reference in a new issue