mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-04-29 16:25:42 +00:00
Merge pull request #577 from JeffProgrammer/ts-objectcopyfailures
Reimplement object copy failures.
This commit is contained in:
commit
328319b853
2 changed files with 10 additions and 1 deletions
|
|
@ -142,6 +142,7 @@ namespace Con
|
||||||
// console variables.
|
// console variables.
|
||||||
extern StringTableEntry gCurrentFile;
|
extern StringTableEntry gCurrentFile;
|
||||||
extern StringTableEntry gCurrentRoot;
|
extern StringTableEntry gCurrentRoot;
|
||||||
|
extern S32 gObjectCopyFailures;
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace Con
|
namespace Con
|
||||||
|
|
@ -972,7 +973,11 @@ ConsoleValue CodeBlock::exec(U32 ip, const char* functionName, Namespace* thisNa
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Con::errorf(ConsoleLogEntry::General, "%s: Unable to find parent object %s for %s.", getFileLine(ip - 1), objParent, callArgv[1].getString());
|
if (Con::gObjectCopyFailures == -1)
|
||||||
|
Con::errorf(ConsoleLogEntry::General, "%s: Unable to find parent object %s for %s.", getFileLine(ip - 1), objParent, callArgv[1].getString());
|
||||||
|
else
|
||||||
|
++Con::gObjectCopyFailures;
|
||||||
|
|
||||||
delete object;
|
delete object;
|
||||||
currentNewObject = NULL;
|
currentNewObject = NULL;
|
||||||
ip = failJump;
|
ip = failJump;
|
||||||
|
|
|
||||||
|
|
@ -300,6 +300,7 @@ Con::ConsoleInputEvent smConsoleInput;
|
||||||
///
|
///
|
||||||
StringTableEntry gCurrentFile;
|
StringTableEntry gCurrentFile;
|
||||||
StringTableEntry gCurrentRoot;
|
StringTableEntry gCurrentRoot;
|
||||||
|
S32 gObjectCopyFailures = -1;
|
||||||
/// @}
|
/// @}
|
||||||
|
|
||||||
bool alwaysUseDebugOutput = true;
|
bool alwaysUseDebugOutput = true;
|
||||||
|
|
@ -373,6 +374,9 @@ void init()
|
||||||
"@ingroup Console\n");
|
"@ingroup Console\n");
|
||||||
addVariable( "instantGroup", TypeRealString, &gInstantGroup, "The group that objects will be added to when they are created.\n"
|
addVariable( "instantGroup", TypeRealString, &gInstantGroup, "The group that objects will be added to when they are created.\n"
|
||||||
"@ingroup Console\n");
|
"@ingroup Console\n");
|
||||||
|
addVariable("Con::objectCopyFailures", TypeS32, &gObjectCopyFailures, "If greater than zero then it counts the number of object creation "
|
||||||
|
"failures based on a missing copy object and does not report an error..\n"
|
||||||
|
"@ingroup Console\n");
|
||||||
|
|
||||||
// Current script file name and root
|
// Current script file name and root
|
||||||
addVariable( "Con::File", TypeString, &gCurrentFile, "The currently executing script file.\n"
|
addVariable( "Con::File", TypeString, &gCurrentFile, "The currently executing script file.\n"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue