2
0
mirror of https://github.com/rehlds/reapi.git synced 2024-12-28 07:35:31 +03:00

Fix GiveC4 hook callback return type (#295)

* Fix GiveC4 hook callback return type
This commit is contained in:
Francisco Muñoz 2023-11-26 06:46:17 -03:00 committed by GitHub
parent 5c38e6f5e4
commit bf8b9bd48a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 7 additions and 6 deletions

View File

@ -1165,6 +1165,7 @@ enum GamedllFunc_CSGameRules
/*
* Description: -
* Return type: CBasePlayer * (Entity index of player)
* Params: ()
*/
RG_CSGameRules_GiveC4,

View File

@ -339,8 +339,8 @@ typedef IHookChain<void> IReGameHook_CSGameRules_RemoveGuns;
typedef IHookChainRegistry<void> IReGameHookRegistry_CSGameRules_RemoveGuns;
// CHalfLifeMultiplay::GiveC4 hook
typedef IHookChain<void> IReGameHook_CSGameRules_GiveC4;
typedef IHookChainRegistry<void> IReGameHookRegistry_CSGameRules_GiveC4;
typedef IHookChain<CBasePlayer *> IReGameHook_CSGameRules_GiveC4;
typedef IHookChainRegistry<CBasePlayer *> IReGameHookRegistry_CSGameRules_GiveC4;
// CHalfLifeMultiplay::ChangeLevel hook
typedef IHookChain<void> IReGameHook_CSGameRules_ChangeLevel;

View File

@ -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<CBasePlayer>(callForward<size_t>(RG_CSGameRules_GiveC4, original));
}
void CSGameRules_ChangeLevel(IReGameHook_CSGameRules_ChangeLevel *chain)

View File

@ -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);