From 4dcfcee3dd80e1bc0f3cacd49d4d3d8e467a0aa6 Mon Sep 17 00:00:00 2001 From: mrbesen Date: Fri, 4 Jun 2021 21:47:28 +0200 Subject: [PATCH] finding beatsaber installation --- src/beatsaber.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/beatsaber.cpp b/src/beatsaber.cpp index 9854616..ca7d0b2 100644 --- a/src/beatsaber.cpp +++ b/src/beatsaber.cpp @@ -43,7 +43,7 @@ std::string findBeatsaberInstallation() { if(!line.empty() && line[0] == '\t') { int num; char pathbuffer[512]; - int res = sscanf(line.c_str(), "\t\"%d\" \t\"%s\"", &num, pathbuffer); + int res = sscanf(line.c_str(), "\t\"%d\" \t\"%[^\"]512s", &num, pathbuffer); if(res == 2) { std::string path(pathbuffer); paths.push_back(path + "/steamapps/"); @@ -52,11 +52,13 @@ std::string findBeatsaberInstallation() { } libinfo.close(); - std::cout << paths.size() << " steam libs found" << std::endl; + //std::cout << paths.size() << " steam libs found" << std::endl; //search in libs for beatsaber for(const std::string& it : paths) { - std::ifstream appmanifest(it + "appmanifest_" + std::to_string(STEAMGAMEID) + ".acf"); + const std::string appmani = it + "appmanifest_" + std::to_string(STEAMGAMEID) + ".acf"; + //std::cout << "Try to read file: " << appmani << std::endl; + std::ifstream appmanifest(appmani); if(appmanifest.is_open()) { //found it! //do stuff with the manifest???