Increased stability Torqu3D: unit-tests running without a crash. See the console.log after ran unitTest_runTests( "", true ). @signmotion

This commit is contained in:
LuisAntonRebollo 2014-05-25 16:50:19 +02:00
parent 29d7fe310d
commit 18ba0646c0
18 changed files with 113 additions and 19 deletions

View file

@ -311,7 +311,8 @@ PhysicsDebris* PhysicsDebris::create( PhysicsDebrisData *datablock,
}
PhysicsDebris::PhysicsDebris()
: mLifetime( 0.0f ),
: mDataBlock( NULL ),
mLifetime( 0.0f ),
mShapeInstance( NULL ),
mWorld( NULL ),
mInitialLinVel( Point3F::Zero )
@ -342,6 +343,12 @@ bool PhysicsDebris::onAdd()
if ( !Parent::onAdd() )
return false;
if( !mDataBlock )
{
Con::errorf("PhysicsDebris::onAdd - Fail - No datablock");
return false;
}
// If it has a fixed lifetime then calculate it.
if ( mDataBlock->lifetime > 0.0f )
{