Merge pull request #1700 from marauder2k9-torque/TSShape-HasAccumulation

fix for hasaccumulation exception
This commit is contained in:
Brian Roberts 2026-03-24 19:04:44 -05:00 committed by GitHub
commit ebaacadeb9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 14 additions and 8 deletions

View file

@ -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)

View file

@ -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 )
{