diff --git a/Engine/source/T3D/shapeBase.cpp b/Engine/source/T3D/shapeBase.cpp index 96fadaf6e..44fe70382 100644 --- a/Engine/source/T3D/shapeBase.cpp +++ b/Engine/source/T3D/shapeBase.cpp @@ -1164,13 +1164,6 @@ void ShapeBase::onRemove() { mConvexList->nukeList(); - Parent::onRemove(); - - // Stop any running sounds on the client - if (isGhost()) - for (S32 i = 0; i < MaxSoundThreads; i++) - stopAudio(i); - // Accumulation and environment mapping if (isClientObject() && mShapeInstance) { @@ -1178,6 +1171,13 @@ void ShapeBase::onRemove() AccumulationVolume::removeObject(this); } + Parent::onRemove(); + + // Stop any running sounds on the client + if (isGhost()) + for (S32 i = 0; i < MaxSoundThreads; i++) + stopAudio(i); + if ( isClientObject() ) { if (mCubeReflector) diff --git a/Engine/source/ts/tsShapeInstance.cpp b/Engine/source/ts/tsShapeInstance.cpp index 2a7cb9c35..337e432fc 100644 --- a/Engine/source/ts/tsShapeInstance.cpp +++ b/Engine/source/ts/tsShapeInstance.cpp @@ -239,8 +239,11 @@ void TSShapeInstance::initMeshObjects() void TSShapeInstance::setMaterialList( TSMaterialList *matList ) { // get rid of old list - if ( mOwnMaterialList ) + if (mOwnMaterialList) + { delete mMaterialList; + mMaterialList = NULL; + } mMaterialList = matList; mOwnMaterialList = false; @@ -891,6 +894,9 @@ void TSShapeInstance::prepCollision() // Returns true is the shape contains any materials with accumulation enabled. bool TSShapeInstance::hasAccumulation() { + if (!mOwnMaterialList || mMaterialList == NULL) + return false; + bool result = false; for ( U32 i = 0; i < mMaterialList->size(); ++i ) {