class EntityGroupSelected : public scene::Graph::Walker
{
- NodeSmartReference group;
+ NodeSmartReference group, worldspawn;
//typedef std::pair<NodeSmartReference, NodeSmartReference> DeletionPair;
//Stack<DeletionPair> deleteme;
public:
- EntityGroupSelected(const scene::Path &p): group(p.top().get())
+ EntityGroupSelected(const scene::Path &p): group(p.top().get()), worldspawn(Map_FindOrInsertWorldspawn(g_map))
{
}
bool pre(const scene::Path& path, scene::Instance& instance) const
NodeSmartReference child(path.top().get());
NodeSmartReference parent(path.parent().get());
- if(path.size() >= 3 && parent != Map_FindOrInsertWorldspawn(g_map))
+ if(path.size() >= 3 && parent != worldspawn)
{
NodeSmartReference parentparent(path[path.size() - 3].get());
class CloneSelected : public scene::Graph::Walker
{
bool doMakeUnique;
+ NodeSmartReference worldspawn;
public:
- CloneSelected(bool d): doMakeUnique(d) { }
+ CloneSelected(bool d): doMakeUnique(d), worldspawn(Map_FindOrInsertWorldspawn(g_map))
+ {
+ }
bool pre(const scene::Path& path, scene::Instance& instance) const
{
if(path.size() == 1)
// ignore worldspawn, but keep checking children
NodeSmartReference me(path.top().get());
- if(me == Map_FindOrInsertWorldspawn(g_map))
+ if(me == worldspawn)
return true;
if(!path.top().get().isRoot())
// ignore worldspawn, but keep checking children
NodeSmartReference me(path.top().get());
- if(me == Map_FindOrInsertWorldspawn(g_map))
+ if(me == worldspawn)
return;
if(!path.top().get().isRoot())
class ExpandSelectionToEntitiesWalker : public scene::Graph::Walker
{
mutable std::size_t m_depth;
+ NodeSmartReference worldspawn;
public:
- ExpandSelectionToEntitiesWalker() : m_depth(0)
+ ExpandSelectionToEntitiesWalker() : m_depth(0), worldspawn(Map_FindOrInsertWorldspawn(g_map))
{
}
bool pre(const scene::Path& path, scene::Instance& instance) const
// ignore worldspawn
NodeSmartReference me(path.top().get());
- if(me == Map_FindOrInsertWorldspawn(g_map))
+ if(me == worldspawn)
return false;
if(m_depth == 2) // entity depth