Skip to content

Commit ee066c4

Browse files
committed
Fixed mtasa:// links not working correctly if MTA is already running
1 parent 9f622a3 commit ee066c4

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

MTA10/loader/MainFunctions.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -191,11 +191,11 @@ void HandleDuplicateLaunching( void )
191191
LPWSTR szCommandLine = GetCommandLineW ();
192192
int numArgs;
193193
LPWSTR* aCommandLineArgs = CommandLineToArgvW ( szCommandLine, &numArgs );
194-
for ( int i = 0; i < numArgs; ++i )
194+
for ( int i = 1; i < numArgs; ++i )
195195
{
196-
if ( StrCmpW ( aCommandLineArgs[i], L"-c" ) == 0 && numArgs > i )
196+
if ( WStringX( aCommandLineArgs[i] ).BeginsWith( L"mtasa://" ) )
197197
{
198-
WString wideConnectInfo = aCommandLineArgs[i + 1];
198+
WString wideConnectInfo = aCommandLineArgs[i];
199199
SString strConnectInfo = ToUTF8 ( wideConnectInfo );
200200

201201
COPYDATASTRUCT cdStruct;

0 commit comments

Comments
 (0)