]> de.git.xonotic.org Git - xonotic/netradiant.git/commitdiff
fix cloning (don't clone the worldspam)
authorRudolf Polzer <divverent@alientrap.org>
Sat, 4 Sep 2010 11:52:03 +0000 (13:52 +0200)
committerRudolf Polzer <divverent@alientrap.org>
Sat, 4 Sep 2010 11:52:03 +0000 (13:52 +0200)
radiant/mainframe.cpp
radiant/select.cpp

index 05d9e52ec00256551a42b4d2b5c30823d344d439..7f7eb061f4b4be77ac2088b33c03dc19cff41fee 100644 (file)
@@ -1196,6 +1196,11 @@ public:
     if(path.size() == 1)
       return true;
 
+    // ignore worldspawn, but keep checking children
+    NodeSmartReference me(path.top().get());
+    if(me == Map_FindOrInsertWorldspawn(g_map))
+           return true;
+
     if(!path.top().get().isRoot())
     {
       Selectable* selectable = Instance_getSelectable(instance);
@@ -1213,6 +1218,11 @@ public:
     if(path.size() == 1)
       return;
 
+    // ignore worldspawn, but keep checking children
+    NodeSmartReference me(path.top().get());
+    if(me == Map_FindOrInsertWorldspawn(g_map))
+           return;
+
     if(!path.top().get().isRoot())
     {
       Selectable* selectable = Instance_getSelectable(instance);
index 19af600673e0304dee73fc9f93aef9926c2e04ba..79721e9b766915d3e4810b03b27895a3b9b76781 100644 (file)
@@ -347,12 +347,18 @@ public:
   bool pre(const scene::Path& path, scene::Instance& instance) const
   {
     ++m_depth;
+
+    // ignore worldspawn
+    NodeSmartReference me(path.top().get());
+    if(me == Map_FindOrInsertWorldspawn(g_map))
+           return false;
+
     if(m_depth == 2) // entity depth
     {
       // traverse and select children if any one is selected
          if(instance.childSelected())
                Instance_setSelected(instance, true);
-      return Node_getEntity(path.top())->isContainer() && instance.childSelected();
+      return Node_getEntity(path.top())->isContainer() && instance.isSelected();
     }
     else if(m_depth == 3) // primitive depth
     {