From: Rudolf Polzer Date: Sat, 4 Sep 2010 11:52:03 +0000 (+0200) Subject: fix cloning (don't clone the worldspam) X-Git-Tag: xonotic-v0.5.0~223 X-Git-Url: https://de.git.xonotic.org/?a=commitdiff_plain;h=5f44865ec295b876cf6907f9f5229ec14321cef2;p=xonotic%2Fnetradiant.git fix cloning (don't clone the worldspam) --- diff --git a/radiant/mainframe.cpp b/radiant/mainframe.cpp index 05d9e52e..7f7eb061 100644 --- a/radiant/mainframe.cpp +++ b/radiant/mainframe.cpp @@ -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); diff --git a/radiant/select.cpp b/radiant/select.cpp index 19af6006..79721e9b 100644 --- a/radiant/select.cpp +++ b/radiant/select.cpp @@ -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 {