]> de.git.xonotic.org Git - xonotic/netradiant.git/blobdiff - radiant/entity.cpp
apparently calling FindOrInsertWorldspawn during tree traversing is bad, so let's...
[xonotic/netradiant.git] / radiant / entity.cpp
index 055de6362f10b58b6204326a3f25cc6a08f7df30..9478bda27ea00fbc84f39cc281b95a6ab50b751e 100644 (file)
@@ -184,11 +184,11 @@ public:
 
 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
@@ -206,7 +206,7 @@ class EntityGroupSelected : public scene::Graph::Walker
                                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());