terrain_filter::match_internal(): use std::make_shared()
(cherry-picked from commit bd5be036b7
)
This commit is contained in:
parent
d99d6bb551
commit
b68901727b
1 changed files with 1 additions and 1 deletions
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue