From 2b8d7855e43e61b15d3488b0cba112544387782f Mon Sep 17 00:00:00 2001 From: AzaezelX Date: Sun, 23 Nov 2025 15:10:37 -0600 Subject: [PATCH] crashfixes IRangeValidatorScaled display was looking in the wrong var afxMagicMissileData was misconverted and lacked a NULL initializer --- Engine/source/afx/afxMagicMissile.cpp | 27 +++++++------------ .../source/gui/editor/guiInspectorTypes.cpp | 2 +- 2 files changed, 10 insertions(+), 19 deletions(-) diff --git a/Engine/source/afx/afxMagicMissile.cpp b/Engine/source/afx/afxMagicMissile.cpp index 46a8d6371..645ca4d32 100644 --- a/Engine/source/afx/afxMagicMissile.cpp +++ b/Engine/source/afx/afxMagicMissile.cpp @@ -242,6 +242,7 @@ afxMagicMissileData::afxMagicMissileData() caster_safety_time = U32_MAX; mProjectileShapeAsset.registerRefreshNotify(this); + projectileShape = NULL; } afxMagicMissileData::afxMagicMissileData(const afxMagicMissileData& other, bool temp_clone) : GameBaseData(other, temp_clone) @@ -530,27 +531,17 @@ bool afxMagicMissileData::preload(bool server, String &errorStr) if (Sim::findObject(lightDescId, lightDesc) == false) Con::errorf(ConsoleLogEntry::General, "afxMagicMissileData::preload: Invalid packet, bad datablockid(lightDesc): %d", lightDescId); } - - U32 assetStatus = ShapeAsset::getAssetErrCode(mProjectileShapeAsset); - if (assetStatus == AssetBase::Ok || assetStatus == AssetBase::UsingFallback) + + if (getProjectileShape()) { - projectileShape = getProjectileShape(); - if (bool(projectileShape) == false) - { - errorStr = String::ToString("afxMagicMissileData::preload: Couldn't load shape \"%s\"", _getProjectileShapeAssetId()); - return false; - } - /* From stock Projectile code... - activateSeq = projectileShape->findSequence("activate"); - maintainSeq = projectileShape->findSequence("maintain"); - */ - } - - if (bool(projectileShape)) // create an instance to preload shape data - { - TSShapeInstance* pDummy = new TSShapeInstance(projectileShape, !server); + TSShapeInstance* pDummy = new TSShapeInstance(getProjectileShape(), !server); delete pDummy; } + else if (mProjectileShapeAsset.notNull()) + { + errorStr = String::ToString("afxMagicMissileData::preload: Couldn't load shape \"%s\"", _getProjectileShapeAssetId()); + return false; + } return true; } diff --git a/Engine/source/gui/editor/guiInspectorTypes.cpp b/Engine/source/gui/editor/guiInspectorTypes.cpp index d6e66c2b8..7db630458 100644 --- a/Engine/source/gui/editor/guiInspectorTypes.cpp +++ b/Engine/source/gui/editor/guiInspectorTypes.cpp @@ -1449,7 +1449,7 @@ GuiControl* GuiInspectorTypeRangedS32::constructEditControl() if (scaledValidator) { retCtrl->setField("range", String::ToString("%d %d", scaledValidator->getMin(), scaledValidator->getMax())); - if (validator->getFidelity() > 1) + if (scaledValidator->getScaleFactor() > 1) retCtrl->setField("increment", String::ToString("%d", scaledValidator->getScaleFactor())); } }