support misc_*model as misc_model in the radiant editor (way more convenient)
[xonotic/netradiant.git] / radiant / entity.cpp
index a572539e65bde0cfd9ba8e557bdda038335792f6..055de6362f10b58b6204326a3f25cc6a08f7df30 100644 (file)
@@ -328,8 +328,7 @@ void Entity_createFromSelection(const char* name, const Vector3& origin)
 
   EntityClass* entityClass = GlobalEntityClassManager().findOrInsert(name, true);
 
 
   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"));
 
     || string_equal_nocase(name, "model_static")
     || (GlobalSelectionSystem().countSelected() == 0 && string_equal_nocase(name, "func_static"));