Add support for CreateIitemEntityByName for CS:GO

This commit is contained in:
Ruben Gonzalez 2017-09-08 08:37:28 -04:00
parent b4d34ef062
commit 3d461ecea1

View File

@ -929,7 +929,16 @@ static cell_t CreateEntityByName(IPluginContext *pContext, const cell_t *params)
char *classname;
pContext->LocalToString(params[1], &classname);
#if SOURCE_ENGINE != SE_CSGO
CBaseEntity *pEntity = (CBaseEntity *)servertools->CreateEntityByName(classname);
#else
CBaseEntity *pEntity = (CBaseEntity *)servertools->CreateItemEntityByName(classname);
if(!pEntity)
{
pEntity = (CBaseEntity *)servertools->CreateEntityByName(classname);
}
#endif
return gamehelpers->EntityToBCompatRef(pEntity);
}
#else