diff --git a/reapi/extra/amxmodx/scripting/include/reapi_gamedll_const.inc b/reapi/extra/amxmodx/scripting/include/reapi_gamedll_const.inc index 58d254c..1b0b963 100644 --- a/reapi/extra/amxmodx/scripting/include/reapi_gamedll_const.inc +++ b/reapi/extra/amxmodx/scripting/include/reapi_gamedll_const.inc @@ -410,7 +410,7 @@ enum GamedllFunc /* * Description: Called when a player is on a ladder. - * Params: (const playerIndex) + * Params: (const pLadder, const playerIndex) */ RG_PM_LadderMove, }; @@ -819,14 +819,14 @@ enum GamedllFunc_CBasePlayer * Params: (const this) */ RG_CBasePlayer_Pain, - + /* * Description: Called when a client emits a "death sound" after death. * Return type: void * Params: (const this, lastHitGroup, bool:hasArmour) */ RG_CBasePlayer_DeathSound, - + /* * Description: Called when a client "thinks for the join status". * (permanently called on each call of "CBasePlayer::PreThink", and only when he is not assigned as specatator or not playing) diff --git a/reapi/include/cssdk/dlls/regamedll_api.h b/reapi/include/cssdk/dlls/regamedll_api.h index 7a9f238..e971ef5 100644 --- a/reapi/include/cssdk/dlls/regamedll_api.h +++ b/reapi/include/cssdk/dlls/regamedll_api.h @@ -39,7 +39,7 @@ #include #define REGAMEDLL_API_VERSION_MAJOR 5 -#define REGAMEDLL_API_VERSION_MINOR 21 +#define REGAMEDLL_API_VERSION_MINOR 22 // CBasePlayer::Spawn hook typedef IHookChainClass IReGameHook_CBasePlayer_Spawn; @@ -525,6 +525,10 @@ typedef IHookChainRegistryClass IReGameHookRegistry_CBa typedef IHookChainClass IReGameHook_CBasePlayer_JoiningThink; typedef IHookChainRegistryClass IReGameHookRegistry_CBasePlayer_JoiningThink; +// FreeGameRules hook +typedef IHookChain IReGameHook_FreeGameRules; +typedef IHookChainRegistry IReGameHookRegistry_FreeGameRules; + class IReGameHookchains { public: virtual ~IReGameHookchains() {} @@ -658,7 +662,8 @@ public: virtual IReGameHookRegistry_CBasePlayer_Pain *CBasePlayer_Pain() = 0; virtual IReGameHookRegistry_CBasePlayer_DeathSound *CBasePlayer_DeathSound() = 0; virtual IReGameHookRegistry_CBasePlayer_JoiningThink *CBasePlayer_JoiningThink() = 0; - + + virtual IReGameHookRegistry_FreeGameRules *FreeGameRules() = 0; virtual IReGameHookRegistry_PM_LadderMove *PM_LadderMove() = 0; }; @@ -677,6 +682,9 @@ struct ReGameFuncs_t { class CGrenade *(*PlantBomb)(entvars_t *pevOwner, Vector &vecStart, Vector &vecVelocity); class CGib *(*SpawnHeadGib)(entvars_t *pevVictim); void (*SpawnRandomGibs)(entvars_t *pevVictim, int cGibs, int human); + void (*UTIL_RestartOther)(const char *szClassname); + void (*UTIL_ResetEntities)(); + void (*UTIL_RemoveOther)(const char *szClassname, int nCount); }; class IReGameApi { diff --git a/reapi/src/hook_callback.cpp b/reapi/src/hook_callback.cpp index 6a35ca8..35066ae 100644 --- a/reapi/src/hook_callback.cpp +++ b/reapi/src/hook_callback.cpp @@ -899,21 +899,19 @@ void PM_AirMove(IReGameHook_PM_AirMove *chain, int playerIndex) callVoidForward(RG_PM_AirMove, original, playerIndex); } -void PM_LadderMove_AMXX(Phys_T *data, int playerIndex) +void PM_LadderMove_AMXX(IReGameHook_PM_LadderMove *chain, physent_t *pLadder, int playerIndex) { - auto original = [data](int _playerIndex) + auto original = [chain](physent_t *_pLadder, int _playerIndex) { - data->m_chain->callNext(data->m_args.pLadder); + chain->callNext(_pLadder); }; - callVoidForward(RG_PM_LadderMove, original, playerIndex); + callVoidForward(RG_PM_LadderMove, original, pLadder, playerIndex); } void PM_LadderMove(IReGameHook_PM_LadderMove *chain, physent_t *pLadder) { - PM_LadderMove_args_t args(pLadder); - Phys_T data(chain, args); - PM_LadderMove_AMXX(&data, pLadder->player + 1); + PM_LadderMove_AMXX(chain, pLadder, pLadder->player + 1); } BOOL CSGameRules_FShouldSwitchWeapon(IReGameHook_CSGameRules_FShouldSwitchWeapon *chain, CBasePlayer *pPlayer, CBasePlayerItem *pWeapon) diff --git a/reapi/src/hook_callback.h b/reapi/src/hook_callback.h index 6bff756..ee8fd3d 100644 --- a/reapi/src/hook_callback.h +++ b/reapi/src/hook_callback.h @@ -402,16 +402,7 @@ void PM_Move_AMXX(Move_t *data, int playerIndex); void PM_Move(IReGameHook_PM_Move *chain, playermove_t *ppmove, int server); void PM_AirMove(IReGameHook_PM_AirMove *chain, int playerIndex); - -struct PM_LadderMove_args_t -{ - PM_LadderMove_args_t(physent_t *_ladder) : pLadder(_ladder) {} - - physent_t *pLadder; -}; - -using Phys_T = hookdata_t; -void PM_LadderMove_AMXX(Phys_T *data); +void PM_LadderMove_AMXX(IReGameHook_PM_LadderMove *chain, physent_t *pLadder, int playerIndex); void PM_LadderMove(IReGameHook_PM_LadderMove *chain, physent_t *pLadder); void HandleMenu_ChooseAppearance(IReGameHook_HandleMenu_ChooseAppearance *chain, CBasePlayer *pPlayer, int slot);