diff options
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; } |