/////////////////////////////////////////////////////////////////////
| 1071 | |
| 1072 | ////////////////////////////////////////////////////////////////////////// |
| 1073 | IEntity* CEntitySystem::FindEntityByName(const char* sEntityName) const |
| 1074 | { |
| 1075 | if (!sEntityName || !sEntityName[0]) |
| 1076 | return 0; // no entity name specified |
| 1077 | |
| 1078 | if (CVar::es_DebugFindEntity != 0) |
| 1079 | { |
| 1080 | CryLog("FindEntityByName: %s", sEntityName); |
| 1081 | if (CVar::es_DebugFindEntity == 2) |
| 1082 | GetISystem()->debug_LogCallStack(); |
| 1083 | } |
| 1084 | |
| 1085 | // Find first object with this name. |
| 1086 | EntityNamesMap::const_iterator it = m_mapEntityNames.lower_bound(sEntityName); |
| 1087 | if (it != m_mapEntityNames.end()) |
| 1088 | { |
| 1089 | if (stricmp(it->first, sEntityName) == 0) |
| 1090 | return GetEntity(it->second); |
| 1091 | } |
| 1092 | |
| 1093 | return 0; // name not found |
| 1094 | } |
| 1095 | |
| 1096 | ////////////////////////////////////////////////////////////////////// |
| 1097 | uint32 CEntitySystem::GetNumEntities() const |
no test coverage detected