summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--editor/imgui.cpp1
-rw-r--r--editor/scenery-editor.cpp1
-rw-r--r--editor/vobj-editor.cpp1
-rw-r--r--src/object.hpp1
4 files changed, 4 insertions, 0 deletions
diff --git a/editor/imgui.cpp b/editor/imgui.cpp
index c8b0dcbd..b548d527 100644
--- a/editor/imgui.cpp
+++ b/editor/imgui.cpp
@@ -392,6 +392,7 @@ void app::do_popup_menu()
e.destroy_script_pre(eʹ, script_destroy_reason::kill);
e.chunk().remove_object(e.index());
e.destroy_script_post();
+ e.gone = true;
}
}
else
diff --git a/editor/scenery-editor.cpp b/editor/scenery-editor.cpp
index b472fca5..2c205e3e 100644
--- a/editor/scenery-editor.cpp
+++ b/editor/scenery-editor.cpp
@@ -99,6 +99,7 @@ start:
eʹ->destroy_script_pre(eʹ, script_destroy_reason::kill);
c.remove_object(i);
eʹ->destroy_script_post();
+ eʹ->gone = true;
goto start;
}
break;
diff --git a/editor/vobj-editor.cpp b/editor/vobj-editor.cpp
index d3eb7bc5..e82c6d27 100644
--- a/editor/vobj-editor.cpp
+++ b/editor/vobj-editor.cpp
@@ -59,6 +59,7 @@ start: while (auto id = a.get_object_colliding_with_cursor())
eʹ->destroy_script_pre(eʹ, script_destroy_reason::kill);
c.remove_object((unsigned)i);
eʹ->destroy_script_post();
+ eʹ->gone = true;
goto start;
}
}
diff --git a/src/object.hpp b/src/object.hpp
index 9de6e880..e121a927 100644
--- a/src/object.hpp
+++ b/src/object.hpp
@@ -56,6 +56,7 @@ struct object
const rotation r = rotation::N; // todo remove bitfield?
const pass_mode pass = pass_mode::see_through;
bool ephemeral : 1 = false;
+ bool gone : 1 = false;
//char _pad[4]; // got 4 bytes left
virtual ~object() noexcept;