mirror of
https://github.com/Mauler125/r5sdk.git
synced 2025-02-09 19:15:03 +01:00
Remove duplicate plugin interface version string literal
This commit is contained in:
parent
a0419eec11
commit
5032644b7f
@ -28,7 +28,6 @@ CPluginSDK::CPluginSDK(const char* pszSelfModule) : m_FactoryInstance(nullptr),
|
||||
//---------------------------------------------------------------------------------
|
||||
CPluginSDK::~CPluginSDK()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------
|
||||
@ -54,12 +53,12 @@ bool CPluginSDK::InitSDK()
|
||||
return false;
|
||||
|
||||
// Let's make sure the SDK version matches with the PluginSystem, else we unload
|
||||
bool isPluginVersionOk = strcmp(m_FactoryInstance->GetFactoryFullName("VPluginSystem"), PLUGINSDK_CLASS_VERSION) == 0;
|
||||
bool isPluginVersionOk = strcmp(m_FactoryInstance->GetFactoryFullName("VPluginSystem"), INTERFACEVERSION_PLUGINSYSTEM) == 0;
|
||||
Assert(isPluginVersionOk, "Version mismatch between CPluginSDK and CPluginSystem.");
|
||||
if (!isPluginVersionOk)
|
||||
return false;
|
||||
|
||||
m_PluginSystem = m_FactoryInstance->GetFactoryPtr(PLUGINSDK_CLASS_VERSION, false).RCast<IPluginSystem*>();
|
||||
m_PluginSystem = m_FactoryInstance->GetFactoryPtr(INTERFACEVERSION_PLUGINSYSTEM, false).RCast<IPluginSystem*>();
|
||||
Assert(m_PluginSystem, "m_PluginSystem was nullptr.");
|
||||
if (!m_PluginSystem)
|
||||
return false;
|
||||
|
@ -21,5 +21,5 @@ private:
|
||||
CModule m_GameModule;
|
||||
CModule m_SDKModule;
|
||||
};
|
||||
constexpr const char* PLUGINSDK_CLASS_VERSION = "VPluginSystem001";
|
||||
|
||||
extern CPluginSDK* g_pPluginSDK;
|
@ -1,5 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#define INTERFACEVERSION_PLUGINSYSTEM "VPluginSystem001"
|
||||
|
||||
struct PluginHelpWithAnything_t
|
||||
{
|
||||
enum class ePluginHelp : int16_t
|
||||
@ -26,5 +28,3 @@ abstract_class IPluginSystem
|
||||
public:
|
||||
virtual void* HelpWithAnything(PluginHelpWithAnything_t * help) = 0;
|
||||
};
|
||||
|
||||
constexpr auto INTERFACEVERSION_PLUGINSYSTEM = "VPluginSystem001";
|
Loading…
x
Reference in New Issue
Block a user