Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RG_CBasePlayer_GiveNamedItem cannot be hooked #271

Closed
JohanCorn opened this issue Mar 26, 2023 · 6 comments
Closed

RG_CBasePlayer_GiveNamedItem cannot be hooked #271

JohanCorn opened this issue Mar 26, 2023 · 6 comments

Comments

@JohanCorn
Copy link

JohanCorn commented Mar 26, 2023

As I can see none of this events (pre or post) can be hooked. Anyone else experienced this?

I mean won't be tiggered on GiveNamedItem calls.

@StevenKal
Copy link

StevenKal commented Mar 27, 2023

Because game often uses "CBasePlayer::GiveNamedItemEx" instead. Resulting original "GiveNamedItem" not called as much as you expected. But it is still called in some buy events.

@JohanCorn
Copy link
Author

Because game often uses "CBasePlayer::GiveNamedItemEx" instead. Resulting original "GiveNamedItem" not called as much as you expected. But it is still called in some buy events.

I expected to work with rg_give_item native call. Should not work with that?

@StevenKal
Copy link

This native uses "GiveNamedItemEx" too, that's why, and yes, it is annoying.
Best on my opinion will be to improve original "GiveNamedItem" & remove the extended one, so all GiveNamedItems calls point to an unique function, and the hook catch it.
But maybe devs wanted to have this separated at the beginning (to differenciate original game calls from API's one), but some parts of the game were later updated to use the extended version, so this is confusing & a little mess with both.

@JohanCorn
Copy link
Author

Since we don't know what they want to do in the future. Maybe implementing a RG_CBasePlayer_GiveNamedItemEx hook should be the best option to keep it separated from the original. What do you think @StevenKal ? Can we make it and put in into a merge request? For my own purpose I will definitely code it (if possibble). I just want to know your opinion... Should we tag someone from the active developers to make the decision?

@StevenKal
Copy link

Sorry I do not work for that "AMXX" thing, or except for money at worst. I know this reapi here is for it, I just take a ride to it sometimes because I follow it, but not more.
Adding a PR to both ReGameDLL_CS & this ReAPI is feasible, but gonna be dormant for months...
I can add the hook to both binaries (like, make a version for you), for a few euros, or, you can use module like Orpheu to memhack the GiveNamedItemEx.

@wopox1337
Copy link
Collaborator

wopox1337 commented Apr 10, 2023

cuz rehlds/ReGameDLL_CS#470 ?

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

No branches or pull requests

3 participants