mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-02-13 03:33:48 +00:00
display the item to be spawned
given a valid datablock name, use that meshes shape to display the spawnsphere mesh, rather than the default one
This commit is contained in:
parent
3e39347167
commit
ed33c70a23
1 changed files with 16 additions and 0 deletions
|
|
@ -433,7 +433,23 @@ void SpawnSphere::unpackUpdate(NetConnection * con, BitStream * stream)
|
|||
mSpawnTransform = stream->readFlag();
|
||||
|
||||
stream->read(&mSpawnClass);
|
||||
|
||||
String oldSDB = mSpawnDataBlock;
|
||||
stream->read(&mSpawnDataBlock);
|
||||
if (oldSDB != mSpawnDataBlock)
|
||||
{
|
||||
ShapeBaseData *spawnedDatablock = dynamic_cast<ShapeBaseData *>(Sim::findObject(mSpawnDataBlock.c_str()));
|
||||
if (spawnedDatablock)
|
||||
{
|
||||
delete mShapeInstance;
|
||||
mShapeInstance = new TSShapeInstance(spawnedDatablock->mShape);
|
||||
}
|
||||
else
|
||||
{
|
||||
delete mShapeInstance;
|
||||
mShapeInstance = new TSShapeInstance(mDataBlock->mShape);
|
||||
}
|
||||
}
|
||||
stream->read(&mSpawnName);
|
||||
stream->read(&mSpawnProperties);
|
||||
stream->read(&mSpawnScript);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue