Exemplo n.º 1
0
// Check existing entities with this classname
// Change there class instance to the new one
void PyEntityFactory::CheckEntities()
{
	CBaseEntity *pEnt;

	pEnt = gEntList.FindEntityByClassname( NULL, m_ClassName );
	while( pEnt )
	{
		if( pEnt->GetPyInstance().ptr() != Py_None )
		{
			pEnt->GetPyInstance().attr("__setattr__")("__class__", m_PyClass);
		}
		pEnt = gEntList.FindEntityByClassname( pEnt, m_ClassName);
	}
}
Exemplo n.º 2
0
bp::object PyHandle::PyGet() const
{
	CBaseEntity *pEnt = Get();
	return pEnt ? pEnt->GetPyInstance() : bp::object();
}