mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-13 15:44:36 +00:00
Merge pull request #1752 from marauder2k9-torque/ScriptFix-ParentCallWithoutThis
Script Fix for Parent call that does not use %this
This commit is contained in:
commit
ebd409c2e9
1 changed files with 16 additions and 4 deletions
|
|
@ -1981,10 +1981,22 @@ Con::EvalResult CodeBlock::exec(U32 ip, const char* functionName, Namespace* thi
|
||||||
}
|
}
|
||||||
else // it's a ParentCall
|
else // it's a ParentCall
|
||||||
{
|
{
|
||||||
ConsoleValue& simObjectLookupValue = callArgv[1];
|
if (callArgc > 1)
|
||||||
thisObject = getThisObject(simObjectLookupValue);
|
{
|
||||||
|
ConsoleValue& simObjectLookupValue = callArgv[1];
|
||||||
|
thisObject = getThisObject(simObjectLookupValue);
|
||||||
|
}
|
||||||
|
|
||||||
if (thisObject == NULL)
|
// The grammar does NOT prepend anything. callArgv[1] is either
|
||||||
|
// a plain script argument (Parent::func(%arg)) or an explicitly
|
||||||
|
// passed %this (Parent::method(%this, %arg)) — the programmer's
|
||||||
|
// choice. For plain function parent calls callArgv[1] is never
|
||||||
|
// an object, so getThisObject returning NULL is expected and
|
||||||
|
// correct, not an error condition. The old guard was aborting
|
||||||
|
// these calls with a misleading "unable to find object" error
|
||||||
|
// using the value of %arg as the object name.
|
||||||
|
|
||||||
|
/*if (thisObject == NULL)
|
||||||
{
|
{
|
||||||
Con::warnf(
|
Con::warnf(
|
||||||
ConsoleLogEntry::General,
|
ConsoleLogEntry::General,
|
||||||
|
|
@ -1998,7 +2010,7 @@ Con::EvalResult CodeBlock::exec(U32 ip, const char* functionName, Namespace* thi
|
||||||
stack[_STK + 1].setEmptyString();
|
stack[_STK + 1].setEmptyString();
|
||||||
_STK++;
|
_STK++;
|
||||||
break;
|
break;
|
||||||
}
|
}*/
|
||||||
|
|
||||||
if (thisNamespace)
|
if (thisNamespace)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue