diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2024-03-02 13:42:16 +0100 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2024-03-02 13:42:16 +0100 |
commit | a6897eb44d181a52bece88f552df81f5d18934b1 (patch) | |
tree | 7fa8cbc1847bc3bb3acb3bf89ad1fad761ba0893 /src | |
parent | 4b005d23ac212cdba1126df5eb51e0a4477179b3 (diff) |
fix error on exit
Diffstat (limited to 'src')
-rw-r--r-- | src/world.cpp | 16 | ||||
-rw-r--r-- | src/world.hpp | 2 |
2 files changed, 7 insertions, 11 deletions
diff --git a/src/world.cpp b/src/world.cpp index 650f1494..d75a835d 100644 --- a/src/world.cpp +++ b/src/world.cpp @@ -198,17 +198,13 @@ auto world::neighbors(chunk_coords_ coord) -> std::array<chunk*, 8> return ret; } -const critter_proto& world::make_player_proto() +critter_proto world::make_player_proto() { - static const critter_proto p = [] - { - critter_proto cproto; - cproto.name = "Player"_s; - cproto.speed = 10; - cproto.playable = true; - return cproto; - }(); - return p; + critter_proto cproto; + cproto.name = "Player"_s; + cproto.speed = 10; + cproto.playable = true; + return cproto; } shared_ptr_wrapper<critter> world::ensure_player_character(object_id& id) diff --git a/src/world.hpp b/src/world.hpp index c6846750..ae6dd329 100644 --- a/src/world.hpp +++ b/src/world.hpp @@ -96,7 +96,7 @@ public: shared_ptr_wrapper<critter> ensure_player_character(object_id& id, critter_proto p); shared_ptr_wrapper<critter> ensure_player_character(object_id& id); - static const critter_proto& make_player_proto(); + static critter_proto make_player_proto(); bool is_teardown() const { return _teardown; } object_id object_counter() const { return _object_counter; } |