diff options
| author | Stanislaw Halik <sthalik@misaki.pl> | 2024-04-08 11:16:28 +0200 |
|---|---|---|
| committer | Stanislaw Halik <sthalik@misaki.pl> | 2024-04-08 19:40:24 +0200 |
| commit | 457cdf24489c20f0f9b9b9877bf9e875aa643f91 (patch) | |
| tree | 5c01a4cbe3935784e30b3a2a2912e62aa00ef29a /src/world.cpp | |
| parent | b25edf465d08750fb5f93068cd8b8d5cd9d0dcec (diff) | |
wip
Diffstat (limited to 'src/world.cpp')
| -rw-r--r-- | src/world.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/world.cpp b/src/world.cpp index 6fdb38ff..2b6407ae 100644 --- a/src/world.cpp +++ b/src/world.cpp @@ -65,14 +65,16 @@ world::world() : world{initial_capacity} world::~world() noexcept { + for (auto& [k, c] : _chunks) + c.on_teardown(); _teardown = true; - for (auto& [k, v] : _chunks) + for (auto& [k, c] : _chunks) { - v._teardown = true; - v.mark_scenery_modified(); - v.mark_passability_modified(); + c._teardown = true; + c.mark_scenery_modified(); + c.mark_passability_modified(); _last_chunk = {}; - arrayResize(v._objects, 0); + arrayResize(c._objects, 0); } _last_chunk = {}; _chunks.clear(); |
