fixed doom3 func_static creation bugs
[xonotic/netradiant.git] / radiant / entity.cpp
index eb4dea509a246154f6de545a8025a7fe759e152a..6fb499fd35589d202661a177d148b993a2534ce0 100644 (file)
@@ -246,7 +246,7 @@ void Entity_createFromSelection(const char* name, const Vector3& origin)
   entitypath.push(makeReference(node.get()));
   scene::Instance& instance = findInstance(entitypath);
 
-  if(entityClass->fixedsize)
+  if(entityClass->fixedsize || (isModel && !brushesSelected))
   {
     Select_Delete();
     
@@ -264,13 +264,13 @@ void Entity_createFromSelection(const char* name, const Vector3& origin)
   }
   else
   {
-    Scene_parentSelectedBrushesToEntity(GlobalSceneGraph(), node);
-    Scene_forEachChildSelectable(SelectableSetSelected(true), instance.path());
-
     if (g_pGameDescription->mGameType == "doom3")
     {
       Node_getEntity(node)->setKeyValue("model", Node_getEntity(node)->getKeyValue("name"));
     }
+
+    Scene_parentSelectedBrushesToEntity(GlobalSceneGraph(), node);
+    Scene_forEachChildSelectable(SelectableSetSelected(true), instance.path());
   }
 
   // tweaking: when right clic dropping a light entity, ask for light value in a custom dialog box