diff --git a/src/terrain/filter.cpp b/src/terrain/filter.cpp index 3ef947d6e9c9..7a86b7417672 100644 --- a/src/terrain/filter.cpp +++ b/src/terrain/filter.cpp @@ -331,7 +331,7 @@ bool terrain_filter::match_internal(const map_location& loc, const unit* ref_uni const wfl::terrain_callable main(fc_->get_disp_context(), loc); wfl::map_formula_callable callable(main.fake_ptr()); if(ref_unit) { - std::shared_ptr ref(new wfl::unit_callable(*ref_unit)); + auto ref = std::make_shared(*ref_unit); callable.add("teleport_unit", wfl::variant(ref)); // It's not destroyed upon scope exit because the variant holds a reference }