Skip to content

Commit

Permalink
Update bms_win32.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
darealshinji authored Apr 13, 2018
1 parent 1be8868 commit c42511c
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions Black Mesa/bms_win32.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,8 @@ int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLi
_putenv(path.c_str());


/* check for a running instance of Steam */
/* check for a running instance of Steam
* and try to launch Steam if needed */

dll = dirname + "\\bin\\steam_api.dll";
hinstLauncher = LoadLibraryEx(dll.c_str(), NULL, LOAD_WITH_ALTERED_SEARCH_PATH);
Expand All @@ -125,9 +126,6 @@ int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLi

pSteamAPI_IsSteamRunning = (SteamAPI_IsSteamRunning_t) GetProcAddress(hinstLauncher, "SteamAPI_IsSteamRunning");


/* try to launch Steam if needed */

if (!pSteamAPI_IsSteamRunning()) {
STARTUPINFO si;
PROCESS_INFORMATION pi;
Expand Down Expand Up @@ -169,15 +167,14 @@ int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLi
MessageBox(0, errmsg, title, type);
return 1;
}
}

if (hinstLauncher) {
FreeLibrary(hinstLauncher);
return 0;
}


/* load launcher.dll */

FreeLibrary(hinstLauncher);
dll = dirname + "\\bin\\launcher.dll";
hinstLauncher = LoadLibraryEx(dll.c_str(), NULL, LOAD_WITH_ALTERED_SEARCH_PATH);

Expand Down

0 comments on commit c42511c

Please sign in to comment.