Fixed crash when creating new entities

This commit is contained in:
2016-01-11 16:47:30 +01:00
parent 2a5e0420c8
commit 349fa9d7fa
+2 -2
View File
@@ -615,8 +615,8 @@ bool EditorSystem::createEntityNode(World* world, EntityID entity)
if (ImGui::BeginPopupContextItem("item context menu")) {
if (ImGui::Button("Add")) {
EntityID entity = world->CreateEntity(entity);
world->AttachComponent(entity, "Transform");
EntityID newEntity = world->CreateEntity(entity);
world->AttachComponent(newEntity, "Transform");
}
ImGui::SameLine();
if (ImGui::Button("Delete")) {