authors clipboard fix

MergeStampAuthorInfo prevents some duplication now, don't need this
This commit is contained in:
jacob1 2017-07-16 21:33:49 -04:00
parent 971e405462
commit ddce20da5b
2 changed files with 4 additions and 4 deletions

View File

@ -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())
{

View File

@ -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);
}
}
}