From 01b41b5078535774b17c317cbee65c8d17370e75 Mon Sep 17 00:00:00 2001 From: kovacsv Date: Sun, 6 Jan 2019 11:27:04 +0100 Subject: [PATCH] FileVersion means compatible file versions so if it is not equal with the read one, the read operation should fail. --- Sources/NodeUIEngine/NUIE_NodeEditor.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Sources/NodeUIEngine/NUIE_NodeEditor.cpp b/Sources/NodeUIEngine/NUIE_NodeEditor.cpp index 3e72cd6c..c127dfd0 100644 --- a/Sources/NodeUIEngine/NUIE_NodeEditor.cpp +++ b/Sources/NodeUIEngine/NUIE_NodeEditor.cpp @@ -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; } @@ -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; }