aboutsummaryrefslogtreecommitdiff
path: root/src/steam.c
diff options
context:
space:
mode:
authorJan200101 <sentrycraft123@gmail.com>2022-09-02 19:19:17 +0200
committerJan200101 <sentrycraft123@gmail.com>2022-09-02 19:19:17 +0200
commita4da54ddf1d41f5bbadf54be7f025a9e7a928eff (patch)
treec91e398d78be80e1660e859915257846f0f88a44 /src/steam.c
parent833b16d109444ed15643246f1f419d6e96f101c3 (diff)
downloadOFQT-a4da54ddf1d41f5bbadf54be7f025a9e7a928eff.tar.gz
OFQT-a4da54ddf1d41f5bbadf54be7f025a9e7a928eff.zip
reverse search vdf's correctly, return on non forks
Diffstat (limited to 'src/steam.c')
-rw-r--r--src/steam.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/steam.c b/src/steam.c
index 387c9b9..f28272c 100644
--- a/src/steam.c
+++ b/src/steam.c
@@ -244,20 +244,23 @@ long getSteamPID(void)
int runOpenFortress(char** args, size_t arg_count)
{
#ifdef STEAM_DIRECT_LAUNCH
+ int in_fork = 0;
#if defined(__linux__) || defined(__FreeBSD__)
// fork so we don't have to stay alive for the game
- if (fork()) return 0;
#endif
-
char* game = getSourceSDK2013MpDir();
if (!game)
- exit(0);
+ {
+ if (in_fork) exit(0);
+ else return 0;
+ }
char* of_dir = getOpenFortressDir();
if (!of_dir)
{
free(game);
- exit(0);
+ if (in_fork) exit(0);
+ else return 0;
}
game = realloc(game, strlen(game) + strlen(OS_PATH_SEP) + strlen(HL2_EXE) + 1);