* fgd: support studio("display/model/path") and flags(Angles)

This commit is contained in:
Garux 2021-04-07 03:06:38 +03:00
parent ceb6ee6051
commit 8d19be1c0e

View File

@ -184,7 +184,6 @@ void EntityClassFGD_parseClass( Tokeniser& tokeniser, bool fixedsize, bool isBas
// hl2 below
else if ( string_equal( property, "sphere" )
|| string_equal( property, "sweptplayerhull" )
|| string_equal( property, "studio" )
|| string_equal( property, "studioprop" )
|| string_equal( property, "lightprop" )
|| string_equal( property, "lightcone" )
@ -195,6 +194,17 @@ void EntityClassFGD_parseClass( Tokeniser& tokeniser, bool fixedsize, bool isBas
}
ASSERT_MESSAGE( EntityClassFGD_parseToken( tokeniser, ")" ), PARSE_ERROR );
}
else if ( string_equal( property, "studio" ) ) {
ASSERT_MESSAGE( EntityClassFGD_parseToken( tokeniser, "(" ), PARSE_ERROR );
const char *token = tokeniser.getToken();
if ( string_equal( token, ")" ) ) {
tokeniser.ungetToken();
}
else{
entityClass->m_modelpath = token;
}
ASSERT_MESSAGE( EntityClassFGD_parseToken( tokeniser, ")" ), PARSE_ERROR );
}
else if ( string_equal( property, "line" )
|| string_equal( property, "cylinder" ) ) {
ASSERT_MESSAGE( EntityClassFGD_parseToken( tokeniser, "(" ), PARSE_ERROR );
@ -226,6 +236,21 @@ void EntityClassFGD_parseClass( Tokeniser& tokeniser, bool fixedsize, bool isBas
}
else if ( string_equal( property, "halfgridsnap" ) ) {
}
else if ( string_equal( property, "flags" ) ) {
ASSERT_MESSAGE( EntityClassFGD_parseToken( tokeniser, "(" ), PARSE_ERROR );
for (;; )
{
const char* base = tokeniser.getToken();
if ( string_equal( base, ")" ) ) {
break;
}
else if ( !string_equal( base, "," ) ) {
if( string_equal_nocase( base, "Angle" ) ){
entityClass->has_angles = true;
}
}
}
}
else
{
ERROR_MESSAGE( PARSE_ERROR );