Raised This Month: $ Target: $400
 0% 

Call_Void_ItemInfo


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
PartialCloning
Senior Member
Join Date: Dec 2015
Old 07-25-2017 , 08:57   Call_Void_ItemInfo
Reply With Quote #1

Is Call_Void_ItemInfo called when using RegisterHam(Ham_Item_GetItemInfo, "weapon_" "Function")?

Code:
cell Call_Void_ItemInfo(AMX *amx, cell *params) {     SETUP(1);     void *ptr=reinterpret_cast<void *>(*MF_GetAmxAddr(amx, params[3]));     if (ptr==0)     {         MF_LogError(amx, AMX_ERR_NATIVE, "Null ItemInfo handle!");         return 0;     } #if defined(_WIN32)     reinterpret_cast<void (__fastcall *)(void*, int, void *)>(__func)(pv, 0, ptr); #elif defined(__linux__) || defined(__APPLE__)     reinterpret_cast<void (*)(void *, void *)>(__func)(pv, ptr); #endif     return 1; }

Ham_Item_GetItemInfo "breaks" any weapon it's hooked for on linux. I'm trying to find out why it does that.

I have read that it's not actually legal to mix reinterpret_cast<> with pointers to void. If Call_Void_ItemInfo is called by RegisterHam, could the bug be caused by the reinterpret_cast? It works on windows OS, but not on linux.
PartialCloning is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 22:44.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode