/////////////////////////////////////////////////////////////////////
| 1973 | |
| 1974 | ////////////////////////////////////////////////////////////////////////// |
| 1975 | void CEntitySystem::SendEventToAll(SEntityEvent& event) |
| 1976 | { |
| 1977 | uint32 dwMaxUsed = (uint32)m_EntitySaltBuffer.GetMaxUsed() + 1; |
| 1978 | |
| 1979 | for (uint32 dwI = 0; dwI < dwMaxUsed; ++dwI) |
| 1980 | { |
| 1981 | CEntity* pEntity = m_EntityArray[dwI]; |
| 1982 | |
| 1983 | if (pEntity) |
| 1984 | pEntity->SendEvent(event); |
| 1985 | } |
| 1986 | |
| 1987 | if (event.event == ENTITY_EVENT_RESET) |
| 1988 | { |
| 1989 | // This stuff is necessary because the reset event currently recreates |
| 1990 | // the character instance and thus removes all attachment data previously set up. |
| 1991 | for (uint32 dwI = 0; dwI < dwMaxUsed; ++dwI) |
| 1992 | { |
| 1993 | CEntity* pEntity = m_EntityArray[dwI]; |
| 1994 | |
| 1995 | if (pEntity) |
| 1996 | { |
| 1997 | // Restore the bone attachment by the deprecated CharAttachHelper. |
| 1998 | if (strcmp(pEntity->GetClass()->GetName(), "CharacterAttachHelper") == 0 |
| 1999 | && pEntity->GetParent()) |
| 2000 | { |
| 2001 | SEntityEvent attachEvent(ENTITY_EVENT_ATTACH_THIS); |
| 2002 | attachEvent.nParam[0] = pEntity->GetParent()->GetId(); |
| 2003 | pEntity->SendEvent(attachEvent); |
| 2004 | } |
| 2005 | } |
| 2006 | } |
| 2007 | } |
| 2008 | } |
| 2009 | |
| 2010 | ////////////////////////////////////////////////////////////////////////// |
| 2011 | void CEntitySystem::GetMemoryStatistics(ICrySizer* pSizer) const |