mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-02-20 23:23:47 +00:00
Increased stability Torqu3D: unit-tests running without a crash. See the console.log after ran unitTest_runTests( "", true ). @signmotion
This commit is contained in:
parent
29d7fe310d
commit
18ba0646c0
18 changed files with 113 additions and 19 deletions
|
|
@ -511,6 +511,12 @@ bool Debris::onAdd()
|
|||
return false;
|
||||
}
|
||||
|
||||
if( !mDataBlock )
|
||||
{
|
||||
Con::errorf("Debris::onAdd - Fail - No datablock");
|
||||
return false;
|
||||
}
|
||||
|
||||
// create emitters
|
||||
for( int i=0; i<DebrisData::DDC_NUM_EMITTERS; i++ )
|
||||
{
|
||||
|
|
@ -653,8 +659,11 @@ void Debris::onRemove()
|
|||
}
|
||||
}
|
||||
|
||||
getSceneManager()->removeObjectFromScene(this);
|
||||
getContainer()->removeObject(this);
|
||||
if( getSceneManager() )
|
||||
getSceneManager()->removeObjectFromScene(this);
|
||||
|
||||
if( getContainer() )
|
||||
getContainer()->removeObject(this);
|
||||
|
||||
Parent::onRemove();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue