Allow working with the parameter "this", which is a class CBaseEntity

This commit is contained in:
A1mDev 2024-11-19 11:06:34 +07:00
parent 945499bd02
commit 88024a71fc

View File

@ -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'"); 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"); return pContext->ThrowNativeError("Parameter 'this' is not specified as an address, it is not available");
} }
@ -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'"); 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"); return pContext->ThrowNativeError("Parameter 'this' is not specified as an address, it is not available");
} }
@ -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'"); 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"); return pContext->ThrowNativeError("Parameter 'this' is not specified as an address, it is not available");
} }
@ -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'"); 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"); return pContext->ThrowNativeError("Parameter 'this' is not specified as an address, it is not available");
} }
@ -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'"); 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"); return pContext->ThrowNativeError("Parameter 'this' is not specified as an address, it is not available");
} }