Skip to content

Commit

Permalink
Allow working with the parameter "this", which is a class CBaseEntity
Browse files Browse the repository at this point in the history
  • Loading branch information
A1mDev committed Nov 19, 2024
1 parent 945499b commit 88024a7
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions extensions/dhooks/natives.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1128,7 +1128,7 @@ cell_t Native_GetParamObjectPtrVar(IPluginContext *pContext, const cell_t *param
return pContext->ThrowNativeError("Parameter 'this' is only available in member functions, specify the calling convention type 'thiscall'");
}*/

if(paramStruct->dg->thisType != ThisPointer_Address)
if(paramStruct->dg->thisType != ThisPointer_Address && paramStruct->dg->thisType != ThisPointer_CBaseEntity)
{
return pContext->ThrowNativeError("Parameter 'this' is not specified as an address, it is not available");
}
Expand Down Expand Up @@ -1224,7 +1224,7 @@ cell_t Native_SetParamObjectPtrVar(IPluginContext *pContext, const cell_t *param
return pContext->ThrowNativeError("Parameter 'this' is only available in member functions, specify the calling convention type 'thiscall'");
}*/

if(paramStruct->dg->thisType != ThisPointer_Address)
if(paramStruct->dg->thisType != ThisPointer_Address && paramStruct->dg->thisType != ThisPointer_CBaseEntity)
{
return pContext->ThrowNativeError("Parameter 'this' is not specified as an address, it is not available");
}
Expand Down Expand Up @@ -1334,7 +1334,7 @@ cell_t Native_GetParamObjectPtrVarVector(IPluginContext *pContext, const cell_t
return pContext->ThrowNativeError("Parameter 'this' is only available in member functions, specify the calling convention type 'thiscall'");
}*/

if(paramStruct->dg->thisType != ThisPointer_Address)
if(paramStruct->dg->thisType != ThisPointer_Address && paramStruct->dg->thisType != ThisPointer_CBaseEntity)
{
return pContext->ThrowNativeError("Parameter 'this' is not specified as an address, it is not available");
}
Expand Down Expand Up @@ -1413,7 +1413,7 @@ cell_t Native_SetParamObjectPtrVarVector(IPluginContext *pContext, const cell_t
return pContext->ThrowNativeError("Parameter 'this' is only available in member functions, specify the calling convention type 'thiscall'");
}*/

if(paramStruct->dg->thisType != ThisPointer_Address)
if(paramStruct->dg->thisType != ThisPointer_Address && paramStruct->dg->thisType != ThisPointer_CBaseEntity)
{
return pContext->ThrowNativeError("Parameter 'this' is not specified as an address, it is not available");
}
Expand Down Expand Up @@ -1491,7 +1491,7 @@ cell_t Native_GetParamObjectPtrString(IPluginContext *pContext, const cell_t *pa
return pContext->ThrowNativeError("Parameter 'this' is only available in member functions, specify the calling convention type 'thiscall'");
}*/

if(paramStruct->dg->thisType != ThisPointer_Address)
if(paramStruct->dg->thisType != ThisPointer_Address && paramStruct->dg->thisType != ThisPointer_CBaseEntity)
{
return pContext->ThrowNativeError("Parameter 'this' is not specified as an address, it is not available");
}
Expand Down

0 comments on commit 88024a7

Please sign in to comment.