-
Notifications
You must be signed in to change notification settings - Fork 37
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
Warn if Metamod is detected. Auto disable it for cstrike. #508
Conversation
…ore flexibility, helper functions are now declared in a separate file
Well, the crucial issue with this code is actually not how you did the string manipulation, but how you declared the functions You can only use Also, when you use Examples: HOOK_DECL(void, __cdecl, PM_PreventMegaBunnyJumping) // Windows, Linux
typedef void(__fastcall *_CBasePlayer__GiveNamedItem)(void *thisptr, int edx, const char *pszName); // Windows
_CBasePlayer__GiveNamedItem ORIG_CBasePlayer__GiveNamedItem;
typedef void(__cdecl *_CBasePlayer__GiveNamedItem_Linux)(void *thisptr, const char *pszName); // Linux
_CBasePlayer__GiveNamedItem_Linux ORIG_CBasePlayer__GiveNamedItem_Linux; #ifdef _WIN32
ORIG_CBasePlayer__GiveNamedItem(classPtr, 0, HwDLL::GetInstance().GetString(iszItem));
#else
ORIG_CBasePlayer__GiveNamedItem_Linux(classPtr, HwDLL::GetInstance().GetString(iszItem));
#endif |
I also made a pull request with the necessary changes to that branch: khanghugo#4 |
Fix metamod PR
Thanks. Looking good. |
Eh, I wouldn't know really. @SmileyAG can explain that. |
…e message about disabling AmxModX
…nterfaces for cause an intentional crash
…riginal path in the end
Made appropriate changes from reviews. And I handled most of edge cases for that request, but let know if I missed something more, he-he. |
ee2ee57
to
799b74c
Compare
…on and .c_str() wouldn't be a dangling pointer at that point I didn't immediately release that the result was a dangling pointer, the life of which ended at the end of the condition Of course, since we didn't allocate memory to it, after the original function is called it will still be freed, but it seems that the engine no longer uses this pointer too, and therefore we don't seem to need to store it.... So even if then it will be dangling, then specifically with this function it should not cause some issues after its call
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to be sure @khanghugo could you test this still works on Linux?
Works for me. |
Thanks |
Closes #501
"Warn" in here means exiting the game right away. I am not sure how to do it more elegantly.