Added World::ValidEntity for checking if an entity exists or not

This commit is contained in:
2016-01-11 13:57:25 +01:00
parent 297a3fb493
commit 21aea6f31d
3 changed files with 8 additions and 6 deletions
+1 -1
View File
@@ -622,7 +622,7 @@ bool EditorSystem::createEntityNode(World* world, EntityID entity)
if (ImGui::Button("Delete")) {
world->DeleteEntity(entity);
ImGui::CloseCurrentPopup();
if (m_Selection == entity) {
if (!world->ValidEntity(m_Selection)) {
m_Selection = EntityID_Invalid;
}
}