diff options
Diffstat (limited to 'editor')
| -rw-r--r-- | editor/imgui.cpp | 5 | ||||
| -rw-r--r-- | editor/scenery-editor.cpp | 3 | ||||
| -rw-r--r-- | editor/vobj-editor.cpp | 3 |
3 files changed, 8 insertions, 3 deletions
diff --git a/editor/imgui.cpp b/editor/imgui.cpp index 3867d227..9f43eda1 100644 --- a/editor/imgui.cpp +++ b/editor/imgui.cpp @@ -338,7 +338,7 @@ void app::do_popup_menu() { const auto [id, target] = _popup_target; auto& w = M->world(); - auto eʹ = w.find_object(id); + const auto eʹ = w.find_object(id); if (target == popup_target_type::none || !eʹ) { @@ -388,7 +388,10 @@ void app::do_popup_menu() ImGui::MenuItem("Rotate", nullptr, false, next_rot != e.r && e.can_rotate(next_rot))) e.rotate(i, next_rot); if (ImGui::MenuItem("Delete", nullptr, false)) + { + //e.on_destroy(eʹ, false); e.chunk().remove_object(e.index()); + } } else _popup_target = {}; diff --git a/editor/scenery-editor.cpp b/editor/scenery-editor.cpp index 07cdbd7c..7a99bbb0 100644 --- a/editor/scenery-editor.cpp +++ b/editor/scenery-editor.cpp @@ -92,8 +92,9 @@ start: while (auto id = a.get_object_colliding_with_cursor()) { for (auto i = 0uz; i < sz; i++) - if (es[i]->id == id) + if (const auto eʹ = es[i]; eʹ->id == id) { + //eʹ->on_destroy(eʹ, false); c.remove_object(i); goto start; } diff --git a/editor/vobj-editor.cpp b/editor/vobj-editor.cpp index f644ca1c..52365fd5 100644 --- a/editor/vobj-editor.cpp +++ b/editor/vobj-editor.cpp @@ -53,8 +53,9 @@ start: while (auto id = a.get_object_colliding_with_cursor()) { for (auto i = (int)(es.size()-1); i >= 0; i--) { - if (es[i]->id == id) + if (const auto eʹ = es[i]; eʹ->id == id) { + //eʹ->on_destroy(eʹ); c.remove_object((unsigned)i); goto start; } |
