Permalink
Browse files

authors clipboard fix

MergeStampAuthorInfo prevents some duplication now, don't need this
  • Loading branch information...
jacob1 committed Jul 17, 2017
1 parent 971e405 commit ddce20da5b50f3e0920b79fa893756ee15f52666
Showing with 4 additions and 4 deletions.
  1. +3 −1 src/client/GameSave.cpp
  2. +1 −3 src/gui/game/GameController.cpp
@@ -637,6 +637,7 @@ void GameSave::readOPS(char * data, int dataLength)
fprintf(stderr, "Wrong type for %s\n", bson_iterator_key(&iter));
}
}
#ifndef RENDERER
else if (!strcmp(bson_iterator_key(&iter), "authors"))
{
if (bson_iterator_type(&iter) == BSON_OBJECT)
@@ -651,6 +652,7 @@ void GameSave::readOPS(char * data, int dataLength)
fprintf(stderr, "Wrong type for %s\n", bson_iterator_key(&iter));
}
}
#endif
}
//Read wall and fan data
@@ -2389,7 +2391,7 @@ std::set<int> GetNestedSaveIDs(Json::Value j)
for (Json::Value::Members::iterator iter = members.begin(), end = members.end(); iter != end; ++iter)
{
std::string member = *iter;
if (member == "id")
if (member == "id" && j[member].isInt())
saveIDs.insert(j[member].asInt());
else if (j[member].isArray())
{
@@ -330,9 +330,7 @@ void GameController::PlaceSave(ui::Point position)
if (!gameModel->GetSimulation()->Load(position.X, position.Y, placeSave))
{
gameModel->SetPaused(placeSave->paused | gameModel->GetPaused());
// if this is a clipboard and there is no author info, don't do anything
if (placeSave->authors.size() && (Client::Ref().IsAuthorsEmpty() || placeSave->authors["type"] != "clipboard"))
Client::Ref().MergeStampAuthorInfo(placeSave->authors);
Client::Ref().MergeStampAuthorInfo(placeSave->authors);
}
}
}

0 comments on commit ddce20d

Please sign in to comment.