From fc24eef7a562f0b61bc355e9a96eabba3fcb5c73 Mon Sep 17 00:00:00 2001 From: Laserlicht <13953785+Laserlicht@users.noreply.github.com> Date: Sat, 5 Jul 2025 15:56:15 +0200 Subject: [PATCH] fixes --- client/mainmenu/CHighScoreScreen.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/client/mainmenu/CHighScoreScreen.cpp b/client/mainmenu/CHighScoreScreen.cpp index 6a4cc7ee4..54b613006 100644 --- a/client/mainmenu/CHighScoreScreen.cpp +++ b/client/mainmenu/CHighScoreScreen.cpp @@ -273,8 +273,11 @@ int CHighScoreInputScreen::addEntry(std::string text) { newNode["points"].Integer() = calc.calculate().cheater ? 0 : calc.calculate().total; newNode["datetime"].String() = TextOperations::getFormattedDateTimeLocal(std::time(nullptr)); newNode["posFlag"].Bool() = true; - JsonSerializer ser(nullptr, newNode); - ser.serializeStruct("statistic", stat); + if(!calc.isCampaign) + { + JsonSerializer ser(nullptr, newNode); + ser.serializeStruct("statistic", stat); + } if (baseNode.size() > HIGHSCORE_ROW_SAVE - 1) baseNode.resize(HIGHSCORE_ROW_SAVE - 1); @@ -284,7 +287,7 @@ int CHighScoreInputScreen::addEntry(std::string text) { int pos = -1; for (int i = 0; i < baseNode.size(); i++) { - if(i >= Statistic::STAT_ROW_SAVE && baseNode[i]["posFlag"].isNull()) + if(!baseNode[i]["statistic"].isNull() && i >= Statistic::STAT_ROW_SAVE && baseNode[i]["posFlag"].isNull()) baseNode[i]["statistic"].clear(); if(!baseNode[i]["posFlag"].isNull())