Skip to content

Conversation

@StevenKal
Copy link
Owner

@StevenKal StevenKal commented Oct 29, 2021

Adjust a few things in the API, then fix issue rehlds#498, then this issue.
Check comments in the commits ("..." at the right of each) for detailled explanations.

Changes reasons:
No need to have those "*_api" functions for standard functions which do not have a different code/format, this is useless.
Besides, passing the "real function used internally by the game" into the list of the structure "ReGameFuncs_t" will allow to retrieve the "real function address".
So, we could "memhack it" and make a hook of the "real function", which is the internal one we want on a hook, not the API one which will only be called when we trigger those API functions.
To finish, this ensures reliability of the function address, and, no need to search it via symbol or signature of bytes where the last can easily be broken.
->
void *pfnAddMultiDamage = (void *)g_pReGameDLLCSFunctions->AddMultiDamage;
Changes reasons:
No need to have those "*_api" functions for standard functions which do not have a different code/format, this is useless.
Besides, passing the "real function used internally by the game" into the list of the structure "ReGameFuncs_t" will allow to retrieve the "real function address".
So, we could "memhack it" and make a hook of the "real function", which is the internal one we want on a hook, not the API one which will only be called when we trigger those API functions.
To finish, this ensures reliability of the function address, and, no need to search it via symbol or signature of bytes where the last can easily be broken.
->
void *pfnAddMultiDamage = (void *)g_pReGameDLLCSFunctions->AddMultiDamage;
Changes:
Add new member "m_bPlantC4Anywhere" to the function "CCSPlayer::Reset".
Update function "CCSPlayer::JoinTeam" in order to drop the C4 when we move a player to spectator (fix issue s1lentq#498).
Update functions "CCSPlayer::DropShield" & "CCSPlayer::DropPlayerItem" by adding return value of the entity created, and provided by ReGameDLL_CS (not the case for the legit CS binary).
Changes:
Update functions "CCSPlayer::DropShield" & "CCSPlayer::DropPlayerItem" by adding return value of the entity created, and provided by ReGameDLL_CS (not the case for the legit CS binary).
Fix condition validity for #define "PLAYER_FREEZE_TIME_OVER" (freeze time over means it is over so we can play, so "!" forgotten).
Changes reasons:
No need to have those "*_api" functions for standard functions which do not have a different code/format, this is useless.
Besides, passing the "real function used internally by the game" into the list of the structure "ReGameFuncs_t" will allow to retrieve the "real function address".
So, we could "memhack it" and make a hook of the "real function", which is the internal one we want on a hook, not the API one which will only be called when we trigger those API functions.
To finish, this ensures reliability of the function address, and, no need to search it via symbol or signature of bytes where the last can easily be broken.
->
void *pfnAddMultiDamage = (void *)g_pReGameDLLCSFunctions->AddMultiDamage;
Changes:
Add new member "m_bPlantC4Anywhere" to the function "CCSPlayer::Reset" (but I hope it will be changed later into an integer for better control).
Update function "CCSPlayer::JoinTeam" in order to drop the C4 when we move a player to spectator (fix issue s1lentq#498).
Update functions "CCSPlayer::DropShield" & "CCSPlayer::DropPlayerItem" by adding return value of the entity created, and provided by ReGameDLL_CS (not the case for the legit CS binary).
@StevenKal StevenKal changed the title API adjustments SK #1. API update SK #1. Oct 29, 2021
Specify this requires a higher version as info (new CCSPlayer's functions format + new member addition).
Export those famous global variables in order to allow an external memhack module to retrieve address and easily get the address of the functions list (but mainly useful for "g_ReGameApiFuncs" here).
Changes:
Update function "CCSPlayer::RemovePlayerItemEx" in order to be "more logic", and support possible blocking of "CBasePlayer::RemovePlayerItem" via modules/plugins (just like they are sometimes used to block "AddPlayerItem", the reverse case should be supported properly...), then force BP ammo removal for exhaustible weapons (granadas), to avoid problems when buying (like the message "You can not carry anymore!" while you no longer have the item, etc.)..
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants