Fix regression with GetEntPropEnt always returning -1 (#584)

Regression in #583

The `CBaseHandle *` was compared to a `IHandleEntity **` always failing
instead of comparing the actual base handles.

Fixes a small typo in MatchTypeDescAsInteger too, where a FIELD_CUSTOM
could fall through badly.
This commit is contained in:
peace-maker 2017-02-09 05:43:15 -07:00 committed by Nicholas Hastings
parent af9852a68f
commit 0743b757f6

View File

@ -1190,6 +1190,7 @@ inline int MatchTypeDescAsInteger(_fieldtypes type, int flags)
// Variant, read as int32.
return 32;
}
break;
case FIELD_SHORT:
return 16;
case FIELD_CHARACTER:
@ -1722,7 +1723,7 @@ static cell_t GetEntPropEnt(IPluginContext *pContext, const cell_t *params)
CBaseEntity *pHandleEntity = g_HL2.ReferenceToEntity(hndl->GetEntryIndex());
if (!pHandleEntity || hndl != &reinterpret_cast<IHandleEntity *>(pHandleEntity)->GetRefEHandle())
if (!pHandleEntity || *hndl != reinterpret_cast<IHandleEntity *>(pHandleEntity)->GetRefEHandle())
return -1;
return g_HL2.EntityToBCompatRef(pHandleEntity);