diff options
author | Jan200101 <sentrycraft123@gmail.com> | 2022-09-02 19:19:17 +0200 |
---|---|---|
committer | Jan200101 <sentrycraft123@gmail.com> | 2022-09-02 19:19:17 +0200 |
commit | a4da54ddf1d41f5bbadf54be7f025a9e7a928eff (patch) | |
tree | c91e398d78be80e1660e859915257846f0f88a44 /src | |
parent | 833b16d109444ed15643246f1f419d6e96f101c3 (diff) | |
download | OFQT-a4da54ddf1d41f5bbadf54be7f025a9e7a928eff.tar.gz OFQT-a4da54ddf1d41f5bbadf54be7f025a9e7a928eff.zip |
reverse search vdf's correctly, return on non forks
Diffstat (limited to 'src')
-rw-r--r-- | src/qt/mainwindow.cpp | 1 | ||||
-rw-r--r-- | src/steam.c | 11 | ||||
-rw-r--r-- | src/vdf/vdf.c | 2 |
3 files changed, 9 insertions, 5 deletions
diff --git a/src/qt/mainwindow.cpp b/src/qt/mainwindow.cpp index 84d6ee9..12ddf3e 100644 --- a/src/qt/mainwindow.cpp +++ b/src/qt/mainwindow.cpp @@ -142,6 +142,7 @@ void MainWindow::workerResult(const enum Worker::Results_t& result) case Worker::RESULT_UPDATE_COMPLETE: resetProgress(); + ui->mainButton->setText("Play"); ui->statusLabel->setText("Updated"); workerOperate(Worker::TASK_IS_UPTODATE); break; 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); diff --git a/src/vdf/vdf.c b/src/vdf/vdf.c index bb27a55..c678e55 100644 --- a/src/vdf/vdf.c +++ b/src/vdf/vdf.c @@ -326,7 +326,7 @@ struct vdf_object* vdf_object_index_array_str(const struct vdf_object* o, const if (!o || !str || o->type != VDF_TYPE_ARRAY) return NULL; - for (size_t i = o->data.data_array.len; i >= 0; ++i) + for (size_t i = o->data.data_array.len-1; i >= 0; --i) { struct vdf_object* k = o->data.data_array.data_value[i]; if (!strcmp(k->key, str)) |