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.