mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-13 15:44:36 +00:00
fix create datablock for physicsshapes.
This commit is contained in:
parent
5fa8504568
commit
17df1362bd
1 changed files with 17 additions and 10 deletions
|
|
@ -271,6 +271,8 @@ bool PhysicsShapeData::preload( bool server, String &errorBuffer )
|
||||||
{
|
{
|
||||||
if ( !Parent::preload( server, errorBuffer ) )
|
if ( !Parent::preload( server, errorBuffer ) )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
if( server ) return true;
|
||||||
|
|
||||||
// If we don't have a physics plugin active then
|
// If we don't have a physics plugin active then
|
||||||
// we have to fail completely.
|
// we have to fail completely.
|
||||||
|
|
@ -280,19 +282,24 @@ bool PhysicsShapeData::preload( bool server, String &errorBuffer )
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( !shapeName || !shapeName[0] )
|
if( shapeName && shapeName[0] != '\0' && !bool(shape) )
|
||||||
{
|
{
|
||||||
errorBuffer = "PhysicsShapeData::preload - No shape name defined.";
|
// Load the shape.
|
||||||
return false;
|
shape = ResourceManager::get().load(shapeName);
|
||||||
}
|
if( bool(shape) == false )
|
||||||
|
{
|
||||||
|
errorBuffer = String::ToString("PhysicsShapeData::load: Couldn't load shape \"%s\"", shapeName);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
TSShapeInstance* pDummy = new TSShapeInstance(shape, !server);
|
||||||
|
delete pDummy;
|
||||||
|
}
|
||||||
|
|
||||||
// Load the shape.
|
|
||||||
shape = ResourceManager::get().load( shapeName );
|
|
||||||
if ( bool(shape) == false )
|
|
||||||
{
|
|
||||||
errorBuffer = String::ToString( "PhysicsShapeData::preload - Unable to load shape '%s'.", shapeName );
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
return false;
|
||||||
|
|
||||||
// Prepare the shared physics collision shape.
|
// Prepare the shared physics collision shape.
|
||||||
if ( !colShape )
|
if ( !colShape )
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue