Fix crash when trying to decode NULL this pointer

When the this pointer is set to ThisPointer_CBaseEntity and the address is null, just return INVALID_ENT_REFERENCE instead of trying to access the pointer.
This commit is contained in:
Peace-Maker 2018-10-05 14:23:38 +02:00
parent 274b4276c0
commit 076d40510c

View File

@ -381,6 +381,8 @@ cell_t GetThisPtr(void *iface, ThisPointerType type)
{
if(type == ThisPointer_CBaseEntity)
{
if (!iface)
return -1;
return gamehelpers->EntityToBCompatRef((CBaseEntity *)iface);
}