add and use Entity::getClassName(), Entity::hasKeyValue()

do not return default value from getKeyValue()
This commit is contained in:
Garux
2021-05-16 10:13:42 +03:00
parent ed04f90497
commit da98f5f9d9
18 changed files with 73 additions and 78 deletions

View File

@@ -70,9 +70,9 @@ public:
Entity* entity = Node_getEntity( node );
if ( entity != 0 ) {
if( entity->isContainer() && Node_getTraversable( node )->empty() && !string_equal( entity->getKeyValue( "classname" ), "worldspawn" )
&& string_empty( entity->getKeyValue( "origin" ) ) ){
globalErrorStream() << "discarding empty group entity: # = " << g_count_entities << "; classname = " << entity->getKeyValue( "classname" ) << "\n";
if( entity->isContainer() && Node_getTraversable( node )->empty() && !string_equal( entity->getClassName(), "worldspawn" )
&& !entity->hasKeyValue( "origin" ) ){
globalErrorStream() << "discarding empty group entity: # = " << g_count_entities << "; classname = " << entity->getClassName() << "\n";
return false;
}
m_writer.writeToken( "//" );