Skip to content

Commit

Permalink
terrain_filter::match_internal(): use std::make_shared()
Browse files Browse the repository at this point in the history
(cherry-picked from commit bd5be03)
  • Loading branch information
jyrkive committed Oct 7, 2018
1 parent d99d6bb commit b689017
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/terrain/filter.cpp
Expand Up @@ -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<wfl::unit_callable> ref(new wfl::unit_callable(*ref_unit));
auto ref = std::make_shared<wfl::unit_callable>(*ref_unit);
callable.add("teleport_unit", wfl::variant(ref));
// It's not destroyed upon scope exit because the variant holds a reference
}
Expand Down

0 comments on commit b689017

Please sign in to comment.