diff --git a/src/ai/composite/aspect.hpp b/src/ai/composite/aspect.hpp index aa47b728061a..2410758b08a1 100644 --- a/src/ai/composite/aspect.hpp +++ b/src/ai/composite/aspect.hpp @@ -212,14 +212,14 @@ class composite_aspect; template class typesafe_known_aspect : public known_aspect { public: - typesafe_known_aspect(const std::string &name, std::shared_ptr< typesafe_aspect> &where, aspect_map &aspects) + typesafe_known_aspect(const std::string &name, typesafe_aspect_ptr& where, aspect_map &aspects) : known_aspect(name), where_(where), aspects_(aspects) { } void set(aspect_ptr a) { - std::shared_ptr< typesafe_aspect > c = std::dynamic_pointer_cast< typesafe_aspect>(a); + typesafe_aspect_ptr c = std::dynamic_pointer_cast>(a); if (c) { assert (c->get_id()== this->get_name()); where_ = c; @@ -242,9 +242,8 @@ class typesafe_known_aspect : public known_aspect { } protected: - std::shared_ptr> &where_; + typesafe_aspect_ptr& where_; aspect_map &aspects_; - }; diff --git a/src/ai/contexts.cpp b/src/ai/contexts.cpp index 9879366526b8..e7118a881833 100644 --- a/src/ai/contexts.cpp +++ b/src/ai/contexts.cpp @@ -174,7 +174,7 @@ synced_command_result_ptr readonly_context_impl::check_synced_command_action(con template -void readonly_context_impl::add_known_aspect(const std::string &name, std::shared_ptr< typesafe_aspect > &where) +void readonly_context_impl::add_known_aspect(const std::string &name, typesafe_aspect_ptr& where) { std::shared_ptr< typesafe_known_aspect > ka_ptr(new typesafe_known_aspect(name,where,aspects_)); known_aspects_.emplace(name,ka_ptr); diff --git a/src/ai/contexts.hpp b/src/ai/contexts.hpp index 73e2308729e6..4ab21487f99e 100644 --- a/src/ai/contexts.hpp +++ b/src/ai/contexts.hpp @@ -1489,7 +1489,7 @@ class readonly_context_impl : public virtual side_context_proxy, public readonly private: template - void add_known_aspect(const std::string &name, std::shared_ptr< typesafe_aspect >& where); + void add_known_aspect(const std::string &name, typesafe_aspect_ptr& where); const config cfg_;