apparently calling FindOrInsertWorldspawn during tree traversing is bad, so let's not do that

This commit is contained in:
Rudolf Polzer
2010-11-01 07:43:42 +01:00
parent 4adf8ad52b
commit 288318d040
3 changed files with 12 additions and 8 deletions

View File

@@ -340,8 +340,9 @@ void Select_Invert()
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
@@ -350,7 +351,7 @@ public:
// ignore worldspawn
NodeSmartReference me(path.top().get());
if(me == Map_FindOrInsertWorldspawn(g_map))
if(me == worldspawn)
return false;
if(m_depth == 2) // entity depth