diff --git a/StoryPresent/storypresent.cpp b/StoryPresent/storypresent.cpp index f2616b2..7dccb43 100644 --- a/StoryPresent/storypresent.cpp +++ b/StoryPresent/storypresent.cpp @@ -122,10 +122,14 @@ void StoryPresent::nodeClickAccept(const QPointF& pos, const QString& node_name) return; } - QList> parent_slices; - std::transform(refers.begin(), refers.end(), std::back_inserter(parent_slices), + QList> vparent_slices; + std::transform(refers.begin(), refers.end(), std::back_inserter(vparent_slices), [](std::shared_ptr ins) { return ins->parentSlice().lock(); }); + QList> parent_slices; + std::copy_if(vparent_slices.begin(), vparent_slices.end(), std::back_inserter(parent_slices), + [](std::shared_ptr ins) -> bool { return ins != nullptr; }); + decltype(parent_slices) fliter_slices; std::copy_if(parent_slices.begin(), parent_slices.end(), std::back_inserter(fliter_slices), [](std::shared_ptr ins) { return ins->type() == SliceType::StoryDefines; });