diff --git a/source/simulation/BaseEntityCollection.cpp b/source/simulation/BaseEntityCollection.cpp index 52ce7d389c..6d2c5a7201 100755 --- a/source/simulation/BaseEntityCollection.cpp +++ b/source/simulation/BaseEntityCollection.cpp @@ -68,28 +68,23 @@ CBaseEntity* CBaseEntityCollection::getTemplate( CStrW name ) newTemplate->loadBase(); } else + { LOG( WARNING, LOG_CATEGORY, "Parent template \"%ls\" does not exist in template \"%ls\"", newTemplate->m_Base_Name.c_str(), newTemplate->m_Tag.c_str() ); // (The requested entity will still be returned, but with no parent. // Is this a reasonable thing to do?) + } } return newTemplate; } -void CBaseEntityCollection::getTemplateNames( std::vector& names ) +void CBaseEntityCollection::getBaseEntityNames( std::vector& names ) { for( templateFilenameMap::iterator it = m_templateFilenames.begin(); it != m_templateFilenames.end(); ++it ) - names.push_back( it->first ); + if( ! (it->first.Length() > 8 && it->first.Left(8) == L"template")) + names.push_back( it->first ); } -#ifdef SCED -// TODO: Fix ScEd, so that it works -CBaseEntity* CBaseEntityCollection::getTemplateByID( int n ) -{ - return m_templates[n]; -} -#endif - CBaseEntityCollection::~CBaseEntityCollection() { for( templateMap::iterator it = m_templates.begin(); it != m_templates.end(); ++it ) diff --git a/source/simulation/BaseEntityCollection.h b/source/simulation/BaseEntityCollection.h index 313399d7ce..82e8ca59ed 100755 --- a/source/simulation/BaseEntityCollection.h +++ b/source/simulation/BaseEntityCollection.h @@ -38,14 +38,9 @@ public: void loadTemplates(); void LoadFile( const char* path ); - // Create a list of the names of all templates, for display in ScEd's - // entity-selection box. (This isn't really very good, since it includes - // 'abstract' entity classes that should never be created, and it doesn't - // split them into useful categories or give them readable names.) - void getTemplateNames( std::vector& names ); -#ifdef SCED // a slightly unpleasant hack, since ScEd can only remember numbers: - CBaseEntity* getTemplateByID( int n ); -#endif + // Create a list of the names of all base entities, excluding template_*, + // for display in ScEd's entity-selection box. + void getBaseEntityNames( std::vector& names ); }; #endif