diff --git a/neo/framework/Common.cpp b/neo/framework/Common.cpp index 5659f56f..b2e67327 100644 --- a/neo/framework/Common.cpp +++ b/neo/framework/Common.cpp @@ -2408,8 +2408,12 @@ void idCommonLocal::Frame( void ) { InitSIMD(); } - if ( com_enableDebuggerServer.IsModified( ) ) { - com_enableDebuggerServer.GetBool( ) ? DebuggerServerInit( ) : DebuggerServerShutdown( ); + if ( com_enableDebuggerServer.IsModified() ) { + if ( com_enableDebuggerServer.GetBool() ) { + DebuggerServerInit(); + } else { + DebuggerServerShutdown(); + } } eventLoop->RunEventLoop(); diff --git a/neo/framework/FileSystem.cpp b/neo/framework/FileSystem.cpp index bbe77f02..31b952a4 100644 --- a/neo/framework/FileSystem.cpp +++ b/neo/framework/FileSystem.cpp @@ -886,10 +886,20 @@ const char *idFileSystemLocal::OSPathToRelativePath( const char *OSPath ) { } if ( base ) { - s = strstr( base, "/" ); - if ( !s ) { - s = strstr( base, "\\" ); + // DG: on Windows base might look like "base\\pak008.pk4/script/doom_util.script" + // while on Linux it'll be more like "base/pak008.pk4/script/doom_util.script" + // I /think/ we want to get rid of the bla.pk4 part, at least that's what happens implicitly on Windows + // (I hope these problems don't exist if the file is not from a .pk4, so that case is handled like before) + s = strstr( base, ".pk4/" ); + if ( s != NULL ) { + s += 4; // skip ".pk4", but *not* the following '/', that'll be skipped below + } else { + s = strchr( base, '/' ); + if ( s == NULL ) { + s = strchr( base, '\\' ); + } } + if ( s ) { strcpy( relativePath, s + 1 ); if ( fs_debug.GetInteger() > 1 ) { diff --git a/neo/tools/debugger/DebuggerServer.cpp b/neo/tools/debugger/DebuggerServer.cpp index f3fe11fe..0b8e284e 100644 --- a/neo/tools/debugger/DebuggerServer.cpp +++ b/neo/tools/debugger/DebuggerServer.cpp @@ -110,7 +110,7 @@ bool rvDebuggerServer::Initialize ( void ) void rvDebuggerServer::OSPathToRelativePath( const char *osPath, idStr &qpath ) { - if ( strchr( osPath, ':' ) ) + if ( strchr( osPath, ':' ) ) // XXX: what about linux? { qpath = fileSystem->OSPathToRelativePath( osPath ); }