diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2024-05-03 18:39:46 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2024-05-05 03:16:22 +0200 |
commit | ba91cb1393274072721e1c31db0c7f73dc9c9db7 (patch) | |
tree | e457bb2ddbd16187c6e2fc34988d09b5afabb659 /src | |
parent | a549fdf835a8548e09084156137cb26e869e8901 (diff) |
expose script init status
Diffstat (limited to 'src')
-rw-r--r-- | src/world.cpp | 5 | ||||
-rw-r--r-- | src/world.hpp | 3 |
2 files changed, 8 insertions, 0 deletions
diff --git a/src/world.cpp b/src/world.cpp index bdc74218..c0a6cc39 100644 --- a/src/world.cpp +++ b/src/world.cpp @@ -262,6 +262,11 @@ void world::finish_scripts() obj->destroy_script_post(); } +struct world::script_status world::script_status() const +{ + return { _script_initialized, _script_finalized }; +} + shared_ptr_wrapper<critter> world::ensure_player_character(object_id& id) { return ensure_player_character(id, make_player_proto()); diff --git a/src/world.hpp b/src/world.hpp index 2a3a26f1..fe434e17 100644 --- a/src/world.hpp +++ b/src/world.hpp @@ -103,8 +103,11 @@ public: shared_ptr_wrapper<critter> ensure_player_character(object_id& id); static critter_proto make_player_proto(); + struct script_status { bool initialized, finalized; }; void init_scripts(); void finish_scripts(); + struct script_status script_status() const; + bool is_teardown() const; object_id object_counter() const { return _object_counter; } [[nodiscard]] object_id make_id() { return ++_object_counter; } |