summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2024-01-16 06:25:42 +0100
committerStanislaw Halik <sthalik@misaki.pl>2024-01-16 06:25:42 +0100
commitae53b814c310d1996db0b818151ef7b205d03b7b (patch)
tree29f9bd53c05fc86d413c815a493b942e0b55dbcd /src
parent1b01f9405fb902ef898dd64aea41af0ffbd9edec (diff)
c
Diffstat (limited to 'src')
-rw-r--r--src/world.cpp38
1 files changed, 19 insertions, 19 deletions
diff --git a/src/world.cpp b/src/world.cpp
index 319892ad..b393a403 100644
--- a/src/world.cpp
+++ b/src/world.cpp
@@ -37,25 +37,25 @@ world::world(std::unordered_map<chunk_coords_, chunk>&& chunks) :
world& world::operator=(world&& w) noexcept
{
- if (&w != this) [[likely]]
- {
- fm_assert(!w._teardown);
- fm_assert(!_teardown);
- _last_collection = w._last_collection;
- _collect_every = w._collect_every;
- _unique_id = std::move(w._unique_id);
- fm_assert(_unique_id);
- fm_debug_assert(w._unique_id == nullptr);
- _last_chunk = {};
- _chunks = std::move(w._chunks);
- _objects = std::move(w._objects);
- _object_counter = w._object_counter;
- _current_frame = w._current_frame;
- w._object_counter = 0;
-
- for (auto& [id, c] : _chunks)
- c._world = this;
- }
+ fm_debug_assert(&w != this);
+ fm_assert(!w._teardown);
+ fm_assert(!_teardown);
+ fm_assert(w._unique_id);
+ _last_chunk = {};
+ _chunks = std::move(w._chunks);
+ _objects = std::move(w._objects);
+ w._objects = safe_ptr<robin_map_wrapper>{};
+ _last_collection = w._last_collection;
+ _collect_every = w._collect_every;
+ _unique_id = std::move(w._unique_id);
+ fm_debug_assert(_unique_id);
+ fm_debug_assert(w._unique_id == nullptr);
+ _object_counter = w._object_counter;
+ w._object_counter = 0;
+ _current_frame = w._current_frame;
+
+ for (auto& [id, c] : _chunks)
+ c._world = this;
return *this;
}