mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-13 07:34:45 +00:00
Merge pull request #1350 from Azaezel/alpha41/callonChildrenCorruption
fix callonchildren varargs
This commit is contained in:
commit
cbc7b034bc
1 changed files with 10 additions and 9 deletions
|
|
@ -231,26 +231,27 @@ void SimSet::scriptSort( const String &scriptCallbackFn )
|
||||||
|
|
||||||
void SimSet::callOnChildren( const String &method, S32 argc, ConsoleValue argv[], bool executeOnChildGroups )
|
void SimSet::callOnChildren( const String &method, S32 argc, ConsoleValue argv[], bool executeOnChildGroups )
|
||||||
{
|
{
|
||||||
// Prep the arguments for the console exec...
|
S32 targc = argc;
|
||||||
// Make sure and leave args[1] empty.
|
|
||||||
ConsoleValue args[21] = { };
|
|
||||||
args[0].setString(method.c_str());
|
|
||||||
|
|
||||||
for (S32 i = 0; i < argc; i++)
|
|
||||||
args[i + 2].setString(argv[i].getString());
|
|
||||||
|
|
||||||
for( iterator i = begin(); i != end(); i++ )
|
for( iterator i = begin(); i != end(); i++ )
|
||||||
{
|
{
|
||||||
SimObject *childObj = static_cast<SimObject*>(*i);
|
SimObject *childObj = static_cast<SimObject*>(*i);
|
||||||
|
|
||||||
|
// Prep the arguments for the console exec...
|
||||||
|
// // Make sure and leave args[1] empty.
|
||||||
|
ConsoleValue args[21] = { };
|
||||||
|
args[0].setString(method.c_str());
|
||||||
|
for (S32 arg = 0; arg < targc; arg++)
|
||||||
|
args[arg + 2].setString(argv[arg].getString());
|
||||||
|
|
||||||
if( childObj->isMethod( method.c_str() ) )
|
if( childObj->isMethod( method.c_str() ) )
|
||||||
Con::execute(childObj, argc + 2, args);
|
Con::execute(childObj, targc + 2, args);
|
||||||
|
|
||||||
if( executeOnChildGroups )
|
if( executeOnChildGroups )
|
||||||
{
|
{
|
||||||
SimSet* childSet = dynamic_cast<SimSet*>(*i);
|
SimSet* childSet = dynamic_cast<SimSet*>(*i);
|
||||||
if ( childSet )
|
if ( childSet )
|
||||||
childSet->callOnChildren( method, argc, argv, executeOnChildGroups );
|
childSet->callOnChildren( method, targc, argv, executeOnChildGroups );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue