summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2024-08-11 12:12:34 +0200
committerStanislaw Halik <sthalik@misaki.pl>2024-08-12 12:25:56 +0200
commit32e5545c8c50f0d16adde2aef9d7b50de01c90b2 (patch)
tree6856da067a755a28bf9b4474c07c1fcc0c155789
parent7576ba2309c33ae894d9a870f7fbe106d94d3750 (diff)
remove object::gone
With `bptr::destroy()` there's no need to be extra careful anymore.
-rw-r--r--editor/imgui.cpp1
-rw-r--r--editor/scenery-editor.cpp1
-rw-r--r--editor/vobj-editor.cpp1
-rw-r--r--src/chunk.cpp2
-rw-r--r--src/object.hpp1
5 files changed, 0 insertions, 6 deletions
diff --git a/editor/imgui.cpp b/editor/imgui.cpp
index c1523522..0e5b56cc 100644
--- a/editor/imgui.cpp
+++ b/editor/imgui.cpp
@@ -393,7 +393,6 @@ 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;
eʹ.destroy();
}
}
diff --git a/editor/scenery-editor.cpp b/editor/scenery-editor.cpp
index 4de14207..7b95df9e 100644
--- a/editor/scenery-editor.cpp
+++ b/editor/scenery-editor.cpp
@@ -99,7 +99,6 @@ start:
e.destroy_script_pre(eʹ, script_destroy_reason::kill);
c.remove_object(i);
e.destroy_script_post();
- e.gone = true;
eʹ.destroy();
goto start;
}
diff --git a/editor/vobj-editor.cpp b/editor/vobj-editor.cpp
index 4c2828e1..7e7dde15 100644
--- a/editor/vobj-editor.cpp
+++ b/editor/vobj-editor.cpp
@@ -61,7 +61,6 @@ start:
e.destroy_script_pre(eʹ, script_destroy_reason::kill);
c.remove_object((unsigned)i);
e.destroy_script_post();
- e.gone = true;
eʹ.destroy();
goto start;
}
diff --git a/src/chunk.cpp b/src/chunk.cpp
index 6ccf3d27..a06d55c3 100644
--- a/src/chunk.cpp
+++ b/src/chunk.cpp
@@ -128,7 +128,6 @@ void chunk::sort_objects()
void chunk::add_object_pre(const bptr<object>& e)
{
- fm_assert(!e->gone);
fm_assert(&*e->c == this);
const auto dyn = e->is_dynamic(), upd = e->updates_passability();
if (!dyn)
@@ -180,7 +179,6 @@ void chunk::remove_object(size_t i)
{
auto& e = *eʹ;
fm_assert(e.c == this);
- fm_assert(!e.gone);
const auto dyn = e.is_dynamic(), upd = e.updates_passability();
if (!dyn)
diff --git a/src/object.hpp b/src/object.hpp
index a73f97b1..e3cbb628 100644
--- a/src/object.hpp
+++ b/src/object.hpp
@@ -57,7 +57,6 @@ struct object : bptr_base
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 override;