From eb4db5f7626780ff3c9d0bd65bc30e7acce5e875 Mon Sep 17 00:00:00 2001 From: Cvolton Date: Fri, 6 Oct 2023 17:54:23 +0200 Subject: [PATCH] fix incorrect level length calculations --- src/utils.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/utils.cpp b/src/utils.cpp index 084c5bd..e88f4e3 100644 --- a/src/utils.cpp +++ b/src/utils.cpp @@ -513,6 +513,7 @@ inline uint64_t timeInMs() { } float BetterInfo::timeForLevelString(const std::string& levelString) { + std::string epicString; try { //todo: checked portals auto a = timeInMs(); @@ -524,7 +525,7 @@ float BetterInfo::timeForLevelString(const std::string& levelString) { std::string currentKey; std::string keyID; - std::stringstream objectStream; + //std::stringstream objectStream; float prevPortalX = 0; int prevPortalId = 0; @@ -536,13 +537,14 @@ float BetterInfo::timeForLevelString(const std::string& levelString) { int objID = 0; float xPos = 0; + /*objectStream.str(""); objectStream.clear(); objectStream << currentObject; objectStream.seekp(0); - objectStream.seekg(0); - //std::stringstream objectStream(currentObject); + objectStream.seekg(0);*/ + std::stringstream objectStream(currentObject); while(getline(objectStream, currentKey, ',')) { - + epicString += currentKey + "\n"; if(i % 2 == 0) keyID = currentKey; else {