diff --git a/src/Core/ScriptExtra/CPointOfInterestExtra.cpp b/src/Core/ScriptExtra/CPointOfInterestExtra.cpp index 8835e501..ea9cad76 100644 --- a/src/Core/ScriptExtra/CPointOfInterestExtra.cpp +++ b/src/Core/ScriptExtra/CPointOfInterestExtra.cpp @@ -1,18 +1,19 @@ #include "CPointOfInterestExtra.h" //@todo pull these values from tweaks instead of hardcoding them -const CColor CPointOfInterestExtra::skRegularColor = CColor::Integral(0xFF,0x70,0x00); -const CColor CPointOfInterestExtra::skImportantColor = CColor::Integral(0xFF,0x00,0x00); +constexpr CColor skRegularColor = CColor::Integral(0xFF,0x70,0x00); +constexpr CColor skImportantColor = CColor::Integral(0xFF,0x00,0x00); CPointOfInterestExtra::CPointOfInterestExtra(CScriptObject *pInstance, CScene *pScene, CScriptNode *pParent) : CScriptExtra(pInstance, pScene, pParent) - , mpScanData(nullptr) { // Fetch scan data property CStructProperty* pProperties = pInstance->Template()->Properties(); - if (mGame <= EGame::Prime) mScanProperty = CAssetRef(pInstance->PropertyData(), pProperties->ChildByIDString("0x04:0x00")); - else mScanProperty = CAssetRef(pInstance->PropertyData(), pProperties->ChildByIDString("0xBDBEC295:0xB94E9BE7")); + if (mGame <= EGame::Prime) + mScanProperty = CAssetRef(pInstance->PropertyData(), pProperties->ChildByIDString("0x04:0x00")); + else + mScanProperty = CAssetRef(pInstance->PropertyData(), pProperties->ChildByIDString("0xBDBEC295:0xB94E9BE7")); PropertyModified(mScanProperty.Property()); } @@ -28,9 +29,11 @@ void CPointOfInterestExtra::PropertyModified(IProperty* pProperty) void CPointOfInterestExtra::ModifyTintColor(CColor& Color) { - if (mpScanData) - { - if (mScanIsCritical) Color *= skImportantColor; - else Color *= skRegularColor; - } + if (!mpScanData) + return; + + if (mScanIsCritical) + Color *= skImportantColor; + else + Color *= skRegularColor; } diff --git a/src/Core/ScriptExtra/CPointOfInterestExtra.h b/src/Core/ScriptExtra/CPointOfInterestExtra.h index 6e3d1d4c..05e76935 100644 --- a/src/Core/ScriptExtra/CPointOfInterestExtra.h +++ b/src/Core/ScriptExtra/CPointOfInterestExtra.h @@ -17,9 +17,6 @@ public: void PropertyModified(IProperty* pProperty) override; void ModifyTintColor(CColor& Color) override; CScan* GetScan() const { return mpScanData; } - - static const CColor skRegularColor; - static const CColor skImportantColor; }; #endif // CPOINTOFINTERESTEXTRA_H