diff --git a/reapi/extra/amxmodx/scripting/include/reapi_gamedll_const.inc b/reapi/extra/amxmodx/scripting/include/reapi_gamedll_const.inc index 9749df4e..bebcc3d1 100644 --- a/reapi/extra/amxmodx/scripting/include/reapi_gamedll_const.inc +++ b/reapi/extra/amxmodx/scripting/include/reapi_gamedll_const.inc @@ -1165,6 +1165,7 @@ enum GamedllFunc_CSGameRules /* * Description: - + * Return type: CBasePlayer * (Entity index of player) * Params: () */ RG_CSGameRules_GiveC4, diff --git a/reapi/include/cssdk/dlls/regamedll_api.h b/reapi/include/cssdk/dlls/regamedll_api.h index 5d5d4861..762d06d6 100644 --- a/reapi/include/cssdk/dlls/regamedll_api.h +++ b/reapi/include/cssdk/dlls/regamedll_api.h @@ -339,8 +339,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/reapi/src/hook_callback.cpp b/reapi/src/hook_callback.cpp index 918c0550..5962a26b 100644 --- a/reapi/src/hook_callback.cpp +++ b/reapi/src/hook_callback.cpp @@ -972,14 +972,14 @@ void CSGameRules_RemoveGuns(IReGameHook_CSGameRules_RemoveGuns *chain) callVoidForward(RG_CSGameRules_RemoveGuns, original); } -void CSGameRules_GiveC4(IReGameHook_CSGameRules_GiveC4 *chain) +CBasePlayer *CSGameRules_GiveC4(IReGameHook_CSGameRules_GiveC4 *chain) { auto original = [chain]() { - chain->callNext(); + return indexOfPDataAmx(chain->callNext()); }; - callVoidForward(RG_CSGameRules_GiveC4, original); + return getPrivate(callForward(RG_CSGameRules_GiveC4, original)); } void CSGameRules_ChangeLevel(IReGameHook_CSGameRules_ChangeLevel *chain) diff --git a/reapi/src/hook_callback.h b/reapi/src/hook_callback.h index 089299d6..af39e6ad 100644 --- a/reapi/src/hook_callback.h +++ b/reapi/src/hook_callback.h @@ -476,7 +476,7 @@ void CSGameRules_CleanUpMap(IReGameHook_CSGameRules_CleanUpMap *chain); void CSGameRules_RestartRound(IReGameHook_CSGameRules_RestartRound *chain); void CSGameRules_CheckWinConditions(IReGameHook_CSGameRules_CheckWinConditions *chain); void CSGameRules_RemoveGuns(IReGameHook_CSGameRules_RemoveGuns *chain); -void CSGameRules_GiveC4(IReGameHook_CSGameRules_GiveC4 *chain); +CBasePlayer *CSGameRules_GiveC4(IReGameHook_CSGameRules_GiveC4 *chain); void CSGameRules_ChangeLevel(IReGameHook_CSGameRules_ChangeLevel *chain); void CSGameRules_GoToIntermission(IReGameHook_CSGameRules_GoToIntermission *chain); void CSGameRules_BalanceTeams(IReGameHook_CSGameRules_BalanceTeams *chain);