From 0cbdfc24b1e5e051993fdf07929a5a006e0f4dba Mon Sep 17 00:00:00 2001 From: Garux Date: Sat, 20 Dec 2025 19:34:47 +0500 Subject: [PATCH] non monitored 'run engine after compile': set CWD to make some engines happy closes #274 --- plugins/vfspk3/archive.cpp | 2 +- radiant/watchbsp.cpp | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/plugins/vfspk3/archive.cpp b/plugins/vfspk3/archive.cpp index 44bf85a4..3f6c3f6f 100644 --- a/plugins/vfspk3/archive.cpp +++ b/plugins/vfspk3/archive.cpp @@ -92,7 +92,7 @@ public: } else if ( const char *ext = path_get_extension( name ); !string_equal( name, "." ) && !string_equal( name, ".." ) - /* skip .pk3dir / .pk4dir / .dpkdir / .pakdir / .waddir the in root, they are processed as DirectoryArchive */ + /* skip .pk3dir / .pk4dir / .dpkdir / .pakdir / .waddir in the root, they are processed as DirectoryArchive */ && !( string_empty( root ) && string_length( ext ) == 6 && string_equal_nocase( ext + 3, "dir" ) ) ) { path.push_filename( name ); diff --git a/radiant/watchbsp.cpp b/radiant/watchbsp.cpp index 37b65209..8a03bfb9 100644 --- a/radiant/watchbsp.cpp +++ b/radiant/watchbsp.cpp @@ -595,8 +595,12 @@ void CWatchBSP::DoEBeginStep(){ return; } // monitoring off or unmonitored command else if( !g_WatchBSP_Enabled || strstr( m_commands[ m_iCurrentStep ].c_str(), RADIANT_MONITOR_ADDRESS ) == nullptr ){ - if( g_WatchBSP_RunQuake ) + if( g_WatchBSP_RunQuake ){ +#ifdef WIN32 // vanilla quake3.exe, ioquake3.x86_64.exe are sensitive to CWD, set it + m_commands.emplace_back( StringStream( "cd /D ", Quoted( EnginePath_get() ) ) ); +#endif m_commands.emplace_back( runEngineCmd( m_sBSPName.c_str() ) ); + } m_commands.erase( m_commands.cbegin(), m_commands.cbegin() + m_iCurrentStep ); RunBatch( m_commands ); return;