Skip to content

Commit

Permalink
FileVersion means compatible file versions so if it is not equal with…
Browse files Browse the repository at this point in the history
… the read one, the read operation should fail.
  • Loading branch information
kovacsv committed Jan 6, 2019
1 parent 38d2d15 commit 01b41b5
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions Sources/NodeUIEngine/NUIE_NodeEditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -242,18 +242,18 @@ bool NodeEditor::Open (NE::InputStream& inputStream, const ExternalHeaderIO* ext
return false;
}

int readFileVersion = 0;
inputStream.Read (readFileVersion);
if (readFileVersion > FileVersion) {
return false;
}

Version readVersion;
readVersion.Read (inputStream);
if (readVersion > EngineVersion) {
return false;
}

int readFileVersion = 0;
inputStream.Read (readFileVersion);
if (readFileVersion != FileVersion) {
return false;
}

if (DBGERROR (!uiManager.Open (inputStream))) {
return false;
}
Expand Down Expand Up @@ -284,8 +284,8 @@ bool NodeEditor::Save (NE::OutputStream& outputStream, const ExternalHeaderIO* e
}

outputStream.Write (NodeEditorFileMarker);
outputStream.Write (FileVersion);
EngineVersion.Write (outputStream);
outputStream.Write (FileVersion);
if (DBGERROR (!uiManager.Save (outputStream))) {
return false;
}
Expand Down

0 comments on commit 01b41b5

Please sign in to comment.