@@ -116,7 +116,7 @@ SH_DECL_MANUALHOOK2_void(CreateWorkshopMapGroup, 0, 0, 0, const char*, const CUt
116116SH_DECL_MANUALHOOK1 (OnTakeDamage_Alive, 0 , 0 , 0 , bool , CTakeDamageInfoContainer *);
117117SH_DECL_MANUALHOOK1_void (CheckMovingGround, 0 , 0 , 0 , double );
118118SH_DECL_HOOK2 (IGameEventManager2, LoadEventsFromFile, SH_NOATTRIB, 0 , int , const char *, bool );
119- SH_DECL_MANUALHOOK2 (GoToIntermission, 0 , 0 , 0 , int64_t *, int64_t , char );
119+ SH_DECL_MANUALHOOK1_void (GoToIntermission, 0 , 0 , 0 , bool );
120120
121121CS2Fixes g_CS2Fixes;
122122
@@ -191,9 +191,6 @@ bool CS2Fixes::Load(PluginId id, ISmmAPI *ismm, char *error, size_t maxlen, bool
191191 int offset = g_GameConfig->GetOffset (" IGameTypes_CreateWorkshopMapGroup" );
192192 SH_MANUALHOOK_RECONFIGURE (CreateWorkshopMapGroup, offset, 0 , 0 );
193193
194- offset = g_GameConfig->GetOffset (" CCSGameRules_GoToIntermission" );
195- SH_MANUALHOOK_RECONFIGURE (GoToIntermission, offset, 0 , 0 );
196-
197194 SH_ADD_HOOK (IServerGameDLL, GameFrame, g_pSource2Server, SH_MEMBER (this , &CS2Fixes::Hook_GameFramePost), true );
198195 SH_ADD_HOOK (IServerGameDLL, GameServerSteamAPIActivated, g_pSource2Server, SH_MEMBER (this , &CS2Fixes::Hook_GameServerSteamAPIActivated), false );
199196 SH_ADD_HOOK (IServerGameDLL, GameServerSteamAPIDeactivated, g_pSource2Server, SH_MEMBER (this , &CS2Fixes::Hook_GameServerSteamAPIDeactivated), false );
@@ -279,6 +276,17 @@ bool CS2Fixes::Load(PluginId id, ISmmAPI *ismm, char *error, size_t maxlen, bool
279276 return false ;
280277 }
281278
279+ auto pCCSGameRulesVTable = modules::server->FindVirtualTable (" CCSGameRules" );
280+
281+ offset = g_GameConfig->GetOffset (" CCSGameRules_GoToIntermission" );
282+ if (offset == -1 )
283+ {
284+ snprintf (error, maxlen, " Failed to find CCSGameRules::GoToIntermission\n " );
285+ bRequiredInitLoaded = false ;
286+ }
287+ SH_MANUALHOOK_RECONFIGURE (GoToIntermission, offset, 0 , 0 );
288+ g_iGoToIntermissionId = SH_ADD_MANUALDVPHOOK (GoToIntermission, pCCSGameRulesVTable, SH_MEMBER (this , &CS2Fixes::Hook_GoToIntermission), false );
289+
282290 Message ( " All hooks started!\n " );
283291
284292 UnlockConVars ();
@@ -876,22 +884,12 @@ void CS2Fixes::Hook_CreateWorkshopMapGroup(const char* name, const CUtlStringLis
876884 RETURN_META (MRES_IGNORED);
877885}
878886
879- void CS2Fixes::CreateGoToIntermissionHook ()
880- {
881- g_iGoToIntermissionId = SH_ADD_MANUALVPHOOK (GoToIntermission, g_pGameRules, SH_MEMBER (this , &CS2Fixes::Hook_GoToIntermission), false );
882- }
883-
884- void CS2Fixes::RemoveGoToIntermissionHook ()
885- {
886- SH_REMOVE_HOOK_ID (g_iGoToIntermissionId);
887- }
888-
889- int64_t * CS2Fixes::Hook_GoToIntermission (int64_t unk1, char unk2)
887+ void CS2Fixes::Hook_GoToIntermission (bool bAbortedMatch)
890888{
891889 if (!g_pMapVoteSystem->IsIntermissionAllowed ())
892- RETURN_META_VALUE (MRES_SUPERCEDE, nullptr );
890+ RETURN_META (MRES_SUPERCEDE);
893891
894- RETURN_META_NOREF (MRES_IGNORED, int64_t * );
892+ RETURN_META (MRES_IGNORED);
895893}
896894
897895bool g_bDropMapWeapons = false ;
0 commit comments