diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2024-07-16 16:45:18 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2024-07-16 16:45:18 +0200 |
commit | 54a90fdfe41abfefca1a4e28969c6e4eff93bd83 (patch) | |
tree | 6d47de3466c4bd7ac5423d5f53247847e28bb124 /src | |
parent | fa2b1ab5fbfb5ce6d9380278dabe2ebab2ab8179 (diff) |
src/world: remove weak_bptr usage
Diffstat (limited to 'src')
-rw-r--r-- | src/world.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/world.cpp b/src/world.cpp index 935ca6c4..89c127cc 100644 --- a/src/world.cpp +++ b/src/world.cpp @@ -6,7 +6,6 @@ #include "scenery-proto.hpp" #include "light.hpp" #include "compat/borrowed-ptr.inl" -#include "compat/weak-borrowed-ptr.inl" #include "compat/hash.hpp" #include "compat/exception.hpp" #include "compat/overloaded.hpp" @@ -27,9 +26,9 @@ size_t world::chunk_coords_hasher::operator()(const chunk_coords_& coord) const } namespace floormat { -struct world::robin_map_wrapper final : tsl::robin_map<object_id, weak_bptr<object>, object_id_hasher> +struct world::robin_map_wrapper final : tsl::robin_map<object_id, bptr<object>, object_id_hasher> { - using tsl::robin_map<object_id, weak_bptr<object>, object_id_hasher>::robin_map; + using tsl::robin_map<object_id, bptr<object>, object_id_hasher>::robin_map; }; world::world(world&& w) noexcept = default; @@ -52,8 +51,8 @@ world& world::operator=(world&& w) noexcept fm_assert(!w._teardown); fm_assert(!_teardown); _last_chunk = {}; - _chunks = move(w._chunks); _objects = move(w._objects); + _chunks = move(w._chunks); w._objects = {}; fm_assert(w._unique_id); _unique_id = move(w._unique_id); @@ -191,7 +190,7 @@ void world::erase_object(object_id id) bptr<object> world::find_object_(object_id id) { auto it = _objects->find(id); - auto ret = it == _objects->end() ? nullptr : it->second.lock(); + auto ret = it == _objects->end() ? nullptr : it->second; fm_debug_assert(!ret || &ret->c->world() == this); return ret; } |