* automatically add ExtraResoucePath to q3map2 arguments, if set

This commit is contained in:
Garux 2021-05-08 10:48:06 +03:00
parent 72248bd95f
commit d1dcc29fa0
2 changed files with 7 additions and 0 deletions

View File

@ -258,6 +258,11 @@ public:
void flush(){
if ( !m_buffer.empty() ) {
m_tool.push_back( new VariableString( m_buffer.c_str() ) );
// q3map2 ExtraResoucePath hack
if( strstr( m_buffer.c_str(), "[RadiantPath]q3map2.[ExecutableType]" ) != nullptr // is q3map2
&& strstr( m_buffer.c_str(), "[ExtraResoucePath]" ) == nullptr ){ // has no extra path right away (could have been added by this before)
m_tool.push_back( new VariableString( "[ExtraResoucePath]" ) );
}
m_buffer.clear();
}
}

View File

@ -163,6 +163,8 @@ void bsp_init(){
build_set_variable( "ExecutableType", RADIANT_EXECUTABLE );
build_set_variable( "EnginePath", EnginePath_get() );
build_set_variable( "UserEnginePath", g_qeglobals.m_userEnginePath.c_str() );
build_set_variable( "ExtraResoucePath", string_empty( ExtraResourcePath_get() )? ""
: StringOutputStream()( " -fs_pakpath ", makeQuoted( ExtraResourcePath_get() ) ) );
build_set_variable( "MonitorAddress", ( g_WatchBSP_Enabled ) ? RADIANT_MONITOR_ADDRESS : "" );
build_set_variable( "GameName", gamename_get() );