mirror of
https://github.com/alliedmodders/amxmodx.git
synced 2024-12-27 23:35:36 +03:00
29 lines
683 B
C++
29 lines
683 B
C++
|
|
||
|
#include "mod_regamedll_api.h"
|
||
|
|
||
|
IReGameApi* ReGameApi;
|
||
|
const ReGameFuncs_t* ReGameFuncs;
|
||
|
IReGameHookchains * ReGameHookchains;
|
||
|
|
||
|
bool RegamedllApi_Init()
|
||
|
{
|
||
|
auto library = GET_GAME_INFO(PLID, GINFO_DLL_FULLPATH);
|
||
|
|
||
|
if (!library || !GET_IFACE<IReGameApi>(library, ReGameApi, VRE_GAMEDLL_API_VERSION, false) || !ReGameApi)
|
||
|
{
|
||
|
return false;
|
||
|
}
|
||
|
|
||
|
auto majorVersion = ReGameApi->GetMajorVersion();
|
||
|
auto minorVersion = ReGameApi->GetMinorVersion();
|
||
|
|
||
|
if (majorVersion != REGAMEDLL_API_VERSION_MAJOR || minorVersion < REGAMEDLL_API_VERSION_MINOR)
|
||
|
{
|
||
|
return false;
|
||
|
}
|
||
|
|
||
|
ReGameFuncs = ReGameApi->GetFuncs();
|
||
|
ReGameHookchains = ReGameApi->GetHookchains();
|
||
|
|
||
|
return true;
|
||
|
}
|