1
0
mirror of https://github.com/alliedmodders/metamod-source.git synced 2024-11-28 10:24:20 +01:00

Fix core load on s2.

This commit is contained in:
Nicholas Hastings 2015-07-09 14:27:18 -04:00
parent 30b7be46a8
commit f65b6c9856
2 changed files with 11 additions and 16 deletions

View File

@ -38,7 +38,7 @@ PossibleSDKs = {
'insurgency': SDK('HL2SDKINSURGENCY', '2.insurgency', '19', 'INSURGENCY', WinLinuxMac, 'insurgency'),
'contagion': SDK('HL2SDKCONTAGION', '2.contagion', '14', 'CONTAGION', WinOnly, 'contagion'),
'bms': SDK('HL2SDKBMS', '2.bms', '10', 'BMS', WinLinux, 'bms'),
'source2': SDK('HL2SDKSOURCE2', '2.s2', '22', 'SOURCE2', WinOnly, 'source2'),
'source2': SDK('HL2SDKSOURCE2', '2.source2', '22', 'SOURCE2', WinOnly, 'source2'),
}
def ResolveEnvPath(env, folder):

View File

@ -300,30 +300,25 @@ public:
virtual InitReturnVal_t Init()
{
mm_backend = MMBackend_Source2;
char error[255];
if (mm_backend == MMBackend_UNKNOWN)
if (!mm_LoadMetamodLibrary(mm_backend, error, sizeof(error)))
{
mm_LogFatal("Could not detect engine version");
mm_LogFatal("Detected engine %d but could not load: %s", mm_backend, error);
}
else
{
if (!mm_LoadMetamodLibrary(mm_backend, error, sizeof(error)))
typedef IGameDllBridge *(*GetGameDllBridge)();
GetGameDllBridge get_bridge = (GetGameDllBridge)mm_GetProcAddress("GetGameDllBridge");
if (get_bridge == NULL)
{
mm_LogFatal("Detected engine %d but could not load: %s", mm_backend, error);
mm_UnloadMetamodLibrary();
mm_LogFatal("Detected engine %d but could not find GetGameDllBridge callback", mm_backend);
}
else
{
typedef IGameDllBridge *(*GetGameDllBridge)();
GetGameDllBridge get_bridge = (GetGameDllBridge)mm_GetProcAddress("GetGameDllBridge");
if (get_bridge == NULL)
{
mm_UnloadMetamodLibrary();
mm_LogFatal("Detected engine %d but could not find GetGameDllBridge callback", mm_backend);
}
else
{
gamedll_bridge = get_bridge();
}
gamedll_bridge = get_bridge();
}
}