Fixed so unregistered components are ignored instead of crashing the game.

This commit is contained in:
William Moberg
2016-03-01 15:53:59 +01:00
parent e2b7e5400d
commit 5c6a652316
4 changed files with 21 additions and 8 deletions
+4 -3
View File
@@ -258,16 +258,17 @@ EntityWrapper EditorSystem::importEntity(EntityWrapper parent, boost::filesystem
return EntityWrapper::Invalid;
}
try {
//try {
auto entityFile = ResourceManager::Load<EntityFile>(filePath.string());
EntityFilePreprocessor fpp(entityFile);
fpp.RegisterComponents(parent.World);
EntityFileParser fp(entityFile);
EntityID newEntity = fp.MergeEntities(parent.World, parent.ID);
return EntityWrapper(parent.World, newEntity);
} catch (const std::exception&) {
/*} catch (const std::exception& e) {
LOG_ERROR("Failed to import entity \"%s\": \"%s\"", filePath.string().c_str(), e.what());
return EntityWrapper::Invalid;
}
}*/
}
void EditorSystem::setWidgetMode(EditorGUI::WidgetMode mode)