X-Git-Url: https://git.xonotic.org/?a=blobdiff_plain;f=radiant%2Fentity.cpp;h=9478bda27ea00fbc84f39cc281b95a6ab50b751e;hb=2f2fcf474924a49952713a4b2b39903d36e5f2ce;hp=a572539e65bde0cfd9ba8e557bdda038335792f6;hpb=c6252fe3fce6b3054e6b80275bea0dc74e19bbd4;p=xonotic%2Fnetradiant.git diff --git a/radiant/entity.cpp b/radiant/entity.cpp index a572539e..9478bda2 100644 --- a/radiant/entity.cpp +++ b/radiant/entity.cpp @@ -184,11 +184,11 @@ public: class EntityGroupSelected : public scene::Graph::Walker { - NodeSmartReference group; + NodeSmartReference group, worldspawn; //typedef std::pair DeletionPair; //Stack 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()); @@ -328,8 +328,7 @@ void Entity_createFromSelection(const char* name, const Vector3& origin) EntityClass* entityClass = GlobalEntityClassManager().findOrInsert(name, true); - bool isModel = string_equal_nocase(name, "misc_model") - || string_equal_nocase(name, "misc_gamemodel") + bool isModel = (string_compare_nocase_n(name, "misc_", 5) == 0 && string_equal_nocase(name + string_length(name) - 5, "model")) // misc_*model (also misc_model) || string_equal_nocase(name, "model_static") || (GlobalSelectionSystem().countSelected() == 0 && string_equal_nocase(name, "func_static"));