diff --git a/Extension/swgchooks.cpp b/Extension/swgchooks.cpp index d5a6ebf..76c04f2 100644 --- a/Extension/swgchooks.cpp +++ b/Extension/swgchooks.cpp @@ -41,7 +41,15 @@ SteamWorksGCHooks::SteamWorksGCHooks() this->pGCMsgAvail = forwards->CreateForward("SteamWorks_GCMsgAvailable", ET_Ignore, 1, NULL, Param_Cell); this->pGCRetMsg = forwards->CreateForward("SteamWorks_GCRetrieveMessage", ET_Event, 5, NULL, Param_Cell, Param_Cell, Param_String, Param_Cell, Param_Cell); - smutils->AddGameFrameHook(OurGCGameFrameHook); + ISteamGameCoordinator *pGC = GetSteamGCPointer(); + if (pGC) + { + this->AddHooks(pGC); + } + else + { + smutils->AddGameFrameHook(OurGCGameFrameHook); + } } SteamWorksGCHooks::~SteamWorksGCHooks() diff --git a/Extension/swgshooks.cpp b/Extension/swgshooks.cpp index d4dfc1d..ef25d9e 100644 --- a/Extension/swgshooks.cpp +++ b/Extension/swgshooks.cpp @@ -42,7 +42,15 @@ SteamWorksGSHooks::SteamWorksGSHooks() this->pFOTR = forwards->CreateForward("SteamWorks_TokenRequested", ET_Ignore, 2, NULL, Param_String, Param_Cell); this->pOBAS = forwards->CreateForward("SteamWorks_BeginAuthSession", ET_Ignore, 3, NULL, Param_Array, Param_Cell, Param_Cell); - smutils->AddGameFrameHook(OurGameFrameHook); + ISteamGameServer *pGameServer = GetGameServerPointer(); + if (pGameServer) + { + this->AddHooks(pGameServer); + } + else + { + smutils->AddGameFrameHook(OurGameFrameHook); + } } SteamWorksGSHooks::~SteamWorksGSHooks()