Fix support for SDKCall returning non-networked entity (#1797)

This commit is contained in:
42
2022-07-08 14:33:43 +00:00
committed by GitHub
parent 278998f7d0
commit 625c7a98f2
+1 -10
View File
@@ -509,16 +509,7 @@ static cell_t SDKCall(IPluginContext *pContext, const cell_t *params)
|| vc->retinfo->vtype == Valve_CBasePlayer) || vc->retinfo->vtype == Valve_CBasePlayer)
{ {
CBaseEntity *pEntity = *(CBaseEntity **)(vc->retbuf); CBaseEntity *pEntity = *(CBaseEntity **)(vc->retbuf);
if (!pEntity) return gamehelpers->EntityToBCompatRef(pEntity);
{
return -1;
}
edict_t *pEdict = gameents->BaseEntityToEdict(pEntity);
if (!pEdict || pEdict->IsFree())
{
return -1;
}
return IndexOfEdict(pEdict);
} else if (vc->retinfo->vtype == Valve_Edict) { } else if (vc->retinfo->vtype == Valve_Edict) {
edict_t *pEdict = *(edict_t **)(vc->retbuf); edict_t *pEdict = *(edict_t **)(vc->retbuf);
if (!pEdict || pEdict->IsFree()) if (!pEdict || pEdict->IsFree())