diff options
| author | Stanislaw Halik <sthalik@misaki.pl> | 2024-03-04 05:25:30 +0100 |
|---|---|---|
| committer | Stanislaw Halik <sthalik@misaki.pl> | 2024-03-04 06:58:22 +0100 |
| commit | b59b5bb320309f0d934ab9bc24d35c63b641b169 (patch) | |
| tree | 20658c6990437025c3fe8024b74eaaa4339aa339 | |
| parent | 5be909e655c1ea728f7e98abbc63bbb9e29c3242 (diff) | |
src: fix incorrect std::move usage
| -rw-r--r-- | src/critter.cpp | 4 | ||||
| -rw-r--r-- | src/world.cpp | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/critter.cpp b/src/critter.cpp index b187c33a..490aa757 100644 --- a/src/critter.cpp +++ b/src/critter.cpp @@ -212,9 +212,9 @@ critter::operator critter_proto() const return ret; } -critter::critter(object_id id, class chunk& c, critter_proto proto) : // todo! check if it gets move-constructed +critter::critter(object_id id, class chunk& c, critter_proto proto) : object{id, c, proto}, - name{proto.name}, + name{move(proto.name)}, speed{proto.speed}, playable{proto.playable} { diff --git a/src/world.cpp b/src/world.cpp index d75a835d..adbcf540 100644 --- a/src/world.cpp +++ b/src/world.cpp @@ -251,7 +251,7 @@ shared_ptr_wrapper<critter> world::ensure_player_character(object_id& id_, critt else { p.playable = true; - ret.ptr = make_object<critter>(make_id(), global_coords{}, p); + ret.ptr = make_object<critter>(make_id(), global_coords{}, move(p)); id_ = ret.ptr->id; } fm_debug_assert(ret.ptr); |
