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:
Dr!fter 2015-11-13 16:26:05 -05:00
parent 0e31eb1e7f
commit 0d3969ba55
5 changed files with 8 additions and 9 deletions

View File

@ -1 +1 @@
2.0.3 2.0.4

View File

@ -197,24 +197,23 @@ cell_t Native_HookRaw(IPluginContext *pContext, const cell_t *params)
} }
bool post = params[2] != 0; bool post = params[2] != 0;
void *iface = (void *)(params[3]);
for(int i = g_pHooks.size() -1; i >= 0; i--) for(int i = g_pHooks.size() -1; i >= 0; i--)
{ {
DHooksManager *manager = g_pHooks.at(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; return manager->hookid;
} }
} }
void *iface = (void *)(params[3]);
if(!iface) if(!iface)
{ {
return pContext->ThrowNativeError("Invalid address passed"); 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) if(!manager->hookid)
{ {
@ -869,7 +868,7 @@ cell_t Native_SetParamObjectPtrVarVector(IPluginContext *pContext, const cell_t
cell_t *buffer; cell_t *buffer;
pContext->LocalToPhysAddr(params[5], &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; Vector *vec;

View File

@ -1 +1 @@
2.0.3-dev 2.0.4-dev

View File

@ -40,7 +40,7 @@
/* Basic information exposed publicly */ /* Basic information exposed publicly */
#define SMEXT_CONF_NAME "DHooks" #define SMEXT_CONF_NAME "DHooks"
#define SMEXT_CONF_DESCRIPTION "Dynamic Hooks" #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_AUTHOR "AlliedModders"
#define SMEXT_CONF_URL "http://www.sourcemod.net/" #define SMEXT_CONF_URL "http://www.sourcemod.net/"
#define SMEXT_CONF_LOGTAG "DHOOKS" #define SMEXT_CONF_LOGTAG "DHOOKS"

View File

@ -18,7 +18,7 @@
#define SM_BUILD_TAG "-manual" #define SM_BUILD_TAG "-manual"
#define SM_BUILD_UNIQUEID "[MANUAL BUILD]" #define SM_BUILD_UNIQUEID "[MANUAL BUILD]"
#define SM_VERSION "2.0.3" #define SM_VERSION "2.0.4"
#define SM_FULL_VERSION SM_VERSION SM_BUILD_TAG #define SM_FULL_VERSION SM_VERSION SM_BUILD_TAG
#define SM_FILE_VERSION 1,0,0,0 #define SM_FILE_VERSION 1,0,0,0