API: Implement RG_PM_LadderMove hook#254
API: Implement RG_PM_LadderMove hook#254s1lentq merged 5 commits intorehlds:masterfrom ShadowsAdi:add-PMLadderMove-hook
API: Implement RG_PM_LadderMove hook#254Conversation
Related to #82
|
useful to create plugins like this: https://dev-cs.ru/threads/19404/ |
|
@s1lentq merge it, please :) |
|
@ShadowsAdi @s1lentq I think this hook should keep the schema of PM_AirMove implementation, keeping physent parameter and an additional player index parameter |
|
@s1lentq // PM_LadderMove hook
typedef IHookChainImpl<void, physent_t *, int> CReGameHook_PM_LadderMove;
typedef IHookChainRegistryImpl<void, physent_t *, int> CReGameHookRegistry_PM_LadderMove;pm_shared.cpp LINK_HOOK_VOID_CHAIN(PM_LadderMove, (physent_t *pLadder, int playerIndex = 0), pLadder, pmove->player_index + 1);
void EXT_FUNC __API_HOOK(PM_LadderMove)(physent_t *pLadder, int playerIndex)
{
PM_LadderMove_internal(pLadder);
}
void PM_LadderMove_internal(physent_t *pLadder)
{
// ...
}regamedll_api.h // PM_LadderMove hook
typedef IHookChain<void, physent_t *, int> IReGameHook_PM_LadderMove;
typedef IHookChainRegistry<void, physent_t *, int> IReGameHookRegistry_PM_LadderMove; |
|
@dystopm I agree about the physent argument. |
|
I see you ended adding the physent argument which I think is fine guessing we can add logic in future to change physent structure values, so it's a yes, I agree with you. In that case, shouldn't PM_AirMove be modified? PD: there's a few of functions which I coded in my own fork which I find useful to be added, I'll be doing a commit taking advantage of you are merging |
No, we should keep API compatibility at least until we update the major version |
Related to #82