refactored EntityClass usage to only store being a miscmodel in miscmodel_is bool + set it on setting classname

* miscmodel filter: simplify and support miscmodels, defined by new way (xml .ent)
This commit is contained in:
Garux
2018-02-19 00:40:51 +03:00
parent feedf4919e
commit 1b673b1a76
7 changed files with 39 additions and 32 deletions

View File

@@ -369,10 +369,10 @@ void Entity_createFromSelection( const char* name, const Vector3& origin ){
EntityClass* entityClass = GlobalEntityClassManager().findOrInsert( name, true );
const bool isModel = EntityClass_miscmodel_is( entityClass )
const bool isModel = entityClass->miscmodel_is
|| ( GlobalSelectionSystem().countSelected() == 0 && classname_equal( name, "func_static" ) && g_pGameDescription->mGameType == "doom3" );
bool brushesSelected = Scene_countSelectedBrushes( GlobalSceneGraph() ) != 0;
const bool brushesSelected = Scene_countSelectedBrushes( GlobalSceneGraph() ) != 0;
//is important to have retexturing here; if doing in the end, undo doesn't succeed;
if ( string_compare_nocase_n( name, "trigger_", 8 ) == 0 && brushesSelected && !entityClass->fixedsize ){