Fix raw hooks not hooking and a bunch of other bugs with them. Fix Object vectors not being able to be set.
This commit is contained in:
parent
0e31eb1e7f
commit
0d3969ba55
@ -1 +1 @@
|
||||
2.0.3
|
||||
2.0.4
|
@ -197,24 +197,23 @@ cell_t Native_HookRaw(IPluginContext *pContext, const cell_t *params)
|
||||
}
|
||||
|
||||
bool post = params[2] != 0;
|
||||
void *iface = (void *)(params[3]);
|
||||
|
||||
for(int i = g_pHooks.size() -1; i >= 0; i--)
|
||||
{
|
||||
DHooksManager *manager = g_pHooks.at(i);
|
||||
if(manager->callback->hookType == HookType_Raw && manager->callback->offset == setup->offset && manager->callback->post == post && manager->remove_callback == pContext->GetFunctionById(params[3]) && manager->callback->plugin_callback == setup->callback)
|
||||
if(manager->callback->hookType == HookType_Raw && manager->addr == (intptr_t)iface && manager->callback->offset == setup->offset && manager->callback->post == post && manager->remove_callback == pContext->GetFunctionById(params[4]) && manager->callback->plugin_callback == setup->callback)
|
||||
{
|
||||
return manager->hookid;
|
||||
}
|
||||
}
|
||||
|
||||
void *iface = (void *)(params[3]);
|
||||
|
||||
if(!iface)
|
||||
{
|
||||
return pContext->ThrowNativeError("Invalid address passed");
|
||||
}
|
||||
|
||||
DHooksManager *manager = new DHooksManager(setup, iface, pContext->GetFunctionById(params[3]), post);
|
||||
DHooksManager *manager = new DHooksManager(setup, iface, pContext->GetFunctionById(params[4]), post);
|
||||
|
||||
if(!manager->hookid)
|
||||
{
|
||||
@ -869,7 +868,7 @@ cell_t Native_SetParamObjectPtrVarVector(IPluginContext *pContext, const cell_t
|
||||
cell_t *buffer;
|
||||
pContext->LocalToPhysAddr(params[5], &buffer);
|
||||
|
||||
if((ObjectValueType)params[4] == ObjectValueType_VectorPtr)
|
||||
if((ObjectValueType)params[4] == ObjectValueType_VectorPtr || (ObjectValueType)params[4] == ObjectValueType_Vector)
|
||||
{
|
||||
Vector *vec;
|
||||
|
||||
|
@ -1 +1 @@
|
||||
2.0.3-dev
|
||||
2.0.4-dev
|
||||
|
@ -40,7 +40,7 @@
|
||||
/* Basic information exposed publicly */
|
||||
#define SMEXT_CONF_NAME "DHooks"
|
||||
#define SMEXT_CONF_DESCRIPTION "Dynamic Hooks"
|
||||
#define SMEXT_CONF_VERSION "2.0.3"
|
||||
#define SMEXT_CONF_VERSION "2.0.4"
|
||||
#define SMEXT_CONF_AUTHOR "AlliedModders"
|
||||
#define SMEXT_CONF_URL "http://www.sourcemod.net/"
|
||||
#define SMEXT_CONF_LOGTAG "DHOOKS"
|
||||
|
Loading…
Reference in New Issue
Block a user