You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently you can only check if the address itself is a null if I'm reading the code here correctly, but when you are getting a param of a type CBaseEntity or Edict it'll check the value stored in the pointer and if it's a NULL it'll error about it here. So currently there's no way to check if you can safely get the entity or edict from a param or not and it'll always error if it's NULL. In my test case DHookIsNullParam() returned false and skipped my if block, so it resulted in a "Exception reported: Trying to get value for null pointer".
Test code snippet:
if(DHookIsNullParam(hParams, 5))
return MRES_Ignored;
int val = DHookGetParam(hParams, 5);
Error happens on the int val = DHookGetParam(hParams, 5); line.
The text was updated successfully, but these errors were encountered:
If the function is optimized to expect some parameter through a register instead of the stack, DHookParam.IsNull might validate the wrong parameter. First we store the stack parameters, then the register parameters in orgParams.
Was your detour setup with at least one parameter passed through a custom register? I've just fixed a bug with DHookIsNullParam, but can't test your usecase.
Currently you can only check if the address itself is a null if I'm reading the code here correctly, but when you are getting a param of a type CBaseEntity or Edict it'll check the value stored in the pointer and if it's a NULL it'll error about it here. So currently there's no way to check if you can safely get the entity or edict from a param or not and it'll always error if it's NULL. In my test case
DHookIsNullParam()
returnedfalse
and skipped my if block, so it resulted in a "Exception reported: Trying to get value for null pointer".Test code snippet:
Error happens on the
int val = DHookGetParam(hParams, 5);
line.The text was updated successfully, but these errors were encountered: