crashfix: make sure mShapeInstance is always assigned valid or NULL

there were a couple code routes that could lead to mShapeInstance holding on to the old ram loc. used SAFE_DELETE preemptively to ensure that never happens.
This commit is contained in:
AzaezelX 2026-06-17 16:49:49 -05:00
parent 280866724d
commit 17d2765592

View file

@ -471,7 +471,7 @@ void SpawnSphere::unpackUpdate(NetConnection * con, BitStream * stream)
stream->read(&mSpawnDataBlock);
if (oldSDB != mSpawnDataBlock)
{
delete mShapeInstance;
SAFE_DELETE(mShapeInstance);
ShapeBaseData *spawnedDatablock = dynamic_cast<ShapeBaseData *>(Sim::findObject(mSpawnDataBlock.c_str()));
if (spawnedDatablock)
{