mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-04-17 10:25:23 +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
|
|
@ -303,6 +303,7 @@ bool SplashData::preload(bool server, String &errorStr)
|
|||
// Splash
|
||||
//--------------------------------------------------------------------------
|
||||
Splash::Splash()
|
||||
: mDataBlock( NULL )
|
||||
{
|
||||
dMemset( mEmitterList, 0, sizeof( mEmitterList ) );
|
||||
|
||||
|
|
@ -353,6 +354,12 @@ bool Splash::onAdd()
|
|||
if(!conn || !Parent::onAdd())
|
||||
return false;
|
||||
|
||||
if( !mDataBlock )
|
||||
{
|
||||
Con::errorf("Splash::onAdd - Fail - No datablock");
|
||||
return false;
|
||||
}
|
||||
|
||||
mDelayMS = mDataBlock->delayMS + sgRandom.randI( -mDataBlock->delayVariance, mDataBlock->delayVariance );
|
||||
mEndingMS = mDataBlock->lifetimeMS + sgRandom.randI( -mDataBlock->lifetimeVariance, mDataBlock->lifetimeVariance );
|
||||
|
||||
|
|
@ -408,8 +415,11 @@ void Splash::onRemove()
|
|||
|
||||
ringList.clear();
|
||||
|
||||
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