From 70f6480a5f6210e3f17027f995a7262c9ed9b47d Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Sun, 3 Aug 2025 02:52:53 +0500 Subject: [PATCH] engine: add a shortcut for loading custom DLLs that follow library naming scheme (like bots) --- engine/common/lib_common.c | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/engine/common/lib_common.c b/engine/common/lib_common.c index 89809661..f37d0369 100644 --- a/engine/common/lib_common.c +++ b/engine/common/lib_common.c @@ -226,32 +226,29 @@ void COM_GetCommonLibraryPath( ECommonLibraryType eLibType, char *out, size_t si case LIBRARY_GAMEUI: if( COM_CheckStringEmpty( host.menulib )) { - Q_strncpy( out, host.menulib, size ); - } - else - { - COM_GenerateClientLibraryPath( "menu", out, size ); + if( host.menulib[0] == '@' ) + COM_GenerateClientLibraryPath( host.menulib + 1, out, size ); + else Q_strncpy( out, host.menulib, size ); } + else COM_GenerateClientLibraryPath( "menu", out, size ); break; case LIBRARY_CLIENT: if( COM_CheckStringEmpty( host.clientlib )) { - Q_strncpy( out, host.clientlib, size ); - } - else - { - COM_GenerateClientLibraryPath( "client", out, size ); + if( host.clientlib[0] == '@' ) + COM_GenerateClientLibraryPath( host.clientlib + 1, out, size ); + else Q_strncpy( out, host.clientlib, size ); } + else COM_GenerateClientLibraryPath( "client", out, size ); break; case LIBRARY_SERVER: if( COM_CheckStringEmpty( host.gamedll )) { - Q_strncpy( out, host.gamedll, size ); - } - else - { - COM_GenerateServerLibraryPath( out, size ); + if( host.gamedll[0] == '@' ) + COM_GenerateClientLibraryPath( host.gamedll + 1, out, size ); + else Q_strncpy( out, host.gamedll, size ); } + else COM_GenerateServerLibraryPath( out, size ); break; default: ASSERT( 0 );