shapes are optional for projectiles. not mandatory.

and stop yelling in the console mid way through loading.
This commit is contained in:
AzaezelX 2025-07-07 16:49:56 -05:00
parent 5dbcaf55c7
commit 4eae51992e
6 changed files with 16 additions and 11 deletions

View file

@ -368,7 +368,6 @@ U32 ShapeAsset::load()
if (!mShape) if (!mShape)
{ {
Con::errorf("ShapeAsset::loadShape : failed to load shape file %s (%s)!", getAssetName(), mShapeFile);
mLoadedState = BadFileReference; mLoadedState = BadFileReference;
return mLoadedState; //if it failed to load, bail out return mLoadedState; //if it failed to load, bail out
} }

View file

@ -276,12 +276,10 @@ bool DebrisData::preload(bool server, String &errorStr)
if (getShape()) if (getShape())
{ {
{ TSShapeInstance* pDummy = new TSShapeInstance(getShape(), !server);
TSShapeInstance* pDummy = new TSShapeInstance(getShape(), !server); delete pDummy;
delete pDummy; if (!server && !getShape()->preloadMaterialList(getShapeFile()) && NetConnection::filesWereDownloaded())
if (!server && !getShape()->preloadMaterialList(getShapeFile()) && NetConnection::filesWereDownloaded()) return false;
return false;
}
} }
else if (!mShapeAsset.isNull()) else if (!mShapeAsset.isNull())
{ {

View file

@ -905,7 +905,13 @@ bool ExplosionData::preload(bool server, String &errorStr)
TSShapeInstance* pDummy = new TSShapeInstance(getExplosionShape(), !server); TSShapeInstance* pDummy = new TSShapeInstance(getExplosionShape(), !server);
delete pDummy; delete pDummy;
} else { }
else if (mExplosionShapeAsset.notNull())
{
errorStr = String::ToString("ExplosionData::preload: Couldn't load shape \"%s\"", _getExplosionShapeAssetId());
return false;
}
else {
explosionAnimation = -1; explosionAnimation = -1;
} }

View file

@ -389,9 +389,9 @@ bool ProjectileData::preload(bool server, String &errorStr)
TSShapeInstance* pDummy = new TSShapeInstance(getProjectileShape(), !server); TSShapeInstance* pDummy = new TSShapeInstance(getProjectileShape(), !server);
delete pDummy; delete pDummy;
} }
else else if (mProjectileShapeAsset.notNull())
{ {
errorStr = String::ToString("ProjectileData::load: Couldn't load shape \"%s\"", _getProjectileShapeAssetId()); errorStr = String::ToString("ProjectileData::preload: Couldn't load shape \"%s\"", _getProjectileShapeAssetId());
return false; return false;
} }

View file

@ -499,6 +499,8 @@ bool ShapeBaseData::preload(bool server, String &errorStr)
} }
} }
} }
else
Con::errorf("ShapeBaseData::preload -%s failed: %s", mShapeAsset.getAssetId(), ShapeAsset::getAssetErrstrn(assetStatus));
} }
if(!server) if(!server)

View file

@ -559,7 +559,7 @@ void TSShapeConstructor::setShapeAssetId(StringTableEntry assetId)
mShapeAsset = mShapeAssetId; mShapeAsset = mShapeAssetId;
if (mShapeAsset.notNull()) if (mShapeAsset.notNull())
{ {
Resource<TSShape> shape = mShapeAsset->getShapeResource(); TSShape* shape = mShapeAsset->getShape();
if (shape) if (shape)
_onLoad(shape); _onLoad(shape);