diff --git a/regamedll/dlls/API/CAPI_Impl.h b/regamedll/dlls/API/CAPI_Impl.h index a66d9e91e..f3de48d83 100644 --- a/regamedll/dlls/API/CAPI_Impl.h +++ b/regamedll/dlls/API/CAPI_Impl.h @@ -458,8 +458,8 @@ typedef IHookChainClassImpl CReGameHook_CSGameRu typedef IHookChainRegistryClassEmptyImpl CReGameHookRegistry_CSGameRules_RemoveGuns; // CHalfLifeMultiplay::GiveC4 hook -typedef IHookChainClassImpl CReGameHook_CSGameRules_GiveC4; -typedef IHookChainRegistryClassEmptyImpl CReGameHookRegistry_CSGameRules_GiveC4; +typedef IHookChainClassImpl CReGameHook_CSGameRules_GiveC4; +typedef IHookChainRegistryClassEmptyImpl CReGameHookRegistry_CSGameRules_GiveC4; // CHalfLifeMultiplay::ChangeLevel hook typedef IHookChainClassImpl CReGameHook_CSGameRules_ChangeLevel; diff --git a/regamedll/dlls/gamerules.h b/regamedll/dlls/gamerules.h index d6590245b..1346de2f9 100644 --- a/regamedll/dlls/gamerules.h +++ b/regamedll/dlls/gamerules.h @@ -578,7 +578,7 @@ class CHalfLifeMultiplay: public CGameRules // check if the scenario has been won/lost virtual void CheckWinConditions(); virtual void RemoveGuns(); - virtual void GiveC4(); + virtual CBasePlayer *GiveC4(); virtual void ChangeLevel(); virtual void GoToIntermission(); @@ -601,7 +601,7 @@ class CHalfLifeMultiplay: public CGameRules void RestartRound_OrigFunc(); void CheckWinConditions_OrigFunc(); void RemoveGuns_OrigFunc(); - void GiveC4_OrigFunc(); + CBasePlayer *GiveC4_OrigFunc(); void ChangeLevel_OrigFunc(); void GoToIntermission_OrigFunc(); void BalanceTeams_OrigFunc(); diff --git a/regamedll/dlls/multiplay_gamerules.cpp b/regamedll/dlls/multiplay_gamerules.cpp index 1a73b36a8..5222cc080 100644 --- a/regamedll/dlls/multiplay_gamerules.cpp +++ b/regamedll/dlls/multiplay_gamerules.cpp @@ -681,9 +681,9 @@ void EXT_FUNC CHalfLifeMultiplay::__API_HOOK(CleanUpMap)() PLAYBACK_EVENT((FEV_GLOBAL | FEV_RELIABLE), 0, m_usResetDecals); } -LINK_HOOK_CLASS_VOID_CUSTOM_CHAIN2(CHalfLifeMultiplay, CSGameRules, GiveC4) +LINK_HOOK_CLASS_CUSTOM_CHAIN2(CBasePlayer *, CHalfLifeMultiplay, CSGameRules, GiveC4) -void EXT_FUNC CHalfLifeMultiplay::__API_HOOK(GiveC4)() +CBasePlayer *EXT_FUNC CHalfLifeMultiplay::__API_HOOK(GiveC4)() { int iTeamCount; int iTemp = 0; @@ -744,7 +744,7 @@ void EXT_FUNC CHalfLifeMultiplay::__API_HOOK(GiveC4)() { #ifdef REGAMEDLL_FIXES // we already have bomber - return; + return pPlayer; #endif } } @@ -772,10 +772,12 @@ void EXT_FUNC CHalfLifeMultiplay::__API_HOOK(GiveC4)() if (pPlayer->pev->deadflag != DEAD_NO || pPlayer->m_iTeam != TERRORIST) continue; - pPlayer->MakeBomber(); - return; + if (pPlayer->MakeBomber()) + return pPlayer; } } + + return nullptr; } void CHalfLifeMultiplay::QueueCareerRoundEndMenu(float tmDelay, int iWinStatus) diff --git a/regamedll/public/regamedll/regamedll_api.h b/regamedll/public/regamedll/regamedll_api.h index 70162c259..d82b2c84d 100644 --- a/regamedll/public/regamedll/regamedll_api.h +++ b/regamedll/public/regamedll/regamedll_api.h @@ -38,7 +38,7 @@ #include #define REGAMEDLL_API_VERSION_MAJOR 5 -#define REGAMEDLL_API_VERSION_MINOR 24 +#define REGAMEDLL_API_VERSION_MINOR 25 // CBasePlayer::Spawn hook typedef IHookChainClass IReGameHook_CBasePlayer_Spawn; @@ -337,8 +337,8 @@ typedef IHookChain IReGameHook_CSGameRules_RemoveGuns; typedef IHookChainRegistry IReGameHookRegistry_CSGameRules_RemoveGuns; // CHalfLifeMultiplay::GiveC4 hook -typedef IHookChain IReGameHook_CSGameRules_GiveC4; -typedef IHookChainRegistry IReGameHookRegistry_CSGameRules_GiveC4; +typedef IHookChain IReGameHook_CSGameRules_GiveC4; +typedef IHookChainRegistry IReGameHookRegistry_CSGameRules_GiveC4; // CHalfLifeMultiplay::ChangeLevel hook typedef IHookChain IReGameHook_CSGameRules_ChangeLevel; diff --git a/regamedll/version/version.h b/regamedll/version/version.h index 554ac4292..cca231b87 100644 --- a/regamedll/version/version.h +++ b/regamedll/version/version.h @@ -6,5 +6,5 @@ #pragma once #define VERSION_MAJOR 5 -#define VERSION_MINOR 23 +#define VERSION_MINOR 25 #define VERSION_MAINTENANCE 0