mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-25 22:42:04 +02:00
fixes
This commit is contained in:
@@ -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())
|
||||
|
||||
Reference in New Issue
Block a user