mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-02-13 11:43:49 +00:00
isobject and obj.delete safties
isobject isn't actually one if it's yet to be properlyAdded, or already marked with isRemoved likewise don't try and delete a deleted thing
This commit is contained in:
parent
2852b33cec
commit
62aadf9114
2 changed files with 12 additions and 1 deletions
|
|
@ -102,7 +102,15 @@ DefineEngineFunction( isObject, bool, (const char * objectName), ,"isObject(obje
|
|||
if (!String::compare(objectName, "0") || !String::compare(objectName, ""))
|
||||
return false;
|
||||
else
|
||||
return (Sim::findObject(objectName) != NULL);
|
||||
{
|
||||
SimObject* obj= Sim::findObject(objectName);
|
||||
if (obj)
|
||||
{
|
||||
if (!obj->isProperlyAdded() || obj->isRemoved())
|
||||
obj = NULL;
|
||||
}
|
||||
return obj != NULL;
|
||||
}
|
||||
}
|
||||
|
||||
ConsoleDocFragment _spawnObject1(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue