Skip to content

Commit

Permalink
authors clipboard fix
Browse files Browse the repository at this point in the history
MergeStampAuthorInfo prevents some duplication now, don't need this
  • Loading branch information
jacob1 committed Jul 17, 2017
1 parent 971e405 commit ddce20d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 3 additions & 1 deletion src/client/GameSave.cpp
Expand Up @@ -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)
Expand All @@ -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
Expand Down Expand Up @@ -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())
{
Expand Down
4 changes: 1 addition & 3 deletions src/gui/game/GameController.cpp
Expand Up @@ -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);
}
}
}
Expand Down

0 comments on commit ddce20d

Please sign in to comment.