Skip to content

Commit 01b41b5

Browse files
committed
FileVersion means compatible file versions so if it is not equal with the read one, the read operation should fail.
1 parent 38d2d15 commit 01b41b5

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

Sources/NodeUIEngine/NUIE_NodeEditor.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -242,18 +242,18 @@ bool NodeEditor::Open (NE::InputStream& inputStream, const ExternalHeaderIO* ext
242242
return false;
243243
}
244244

245-
int readFileVersion = 0;
246-
inputStream.Read (readFileVersion);
247-
if (readFileVersion > FileVersion) {
248-
return false;
249-
}
250-
251245
Version readVersion;
252246
readVersion.Read (inputStream);
253247
if (readVersion > EngineVersion) {
254248
return false;
255249
}
256250

251+
int readFileVersion = 0;
252+
inputStream.Read (readFileVersion);
253+
if (readFileVersion != FileVersion) {
254+
return false;
255+
}
256+
257257
if (DBGERROR (!uiManager.Open (inputStream))) {
258258
return false;
259259
}
@@ -284,8 +284,8 @@ bool NodeEditor::Save (NE::OutputStream& outputStream, const ExternalHeaderIO* e
284284
}
285285

286286
outputStream.Write (NodeEditorFileMarker);
287-
outputStream.Write (FileVersion);
288287
EngineVersion.Write (outputStream);
288+
outputStream.Write (FileVersion);
289289
if (DBGERROR (!uiManager.Save (outputStream))) {
290290
return false;
291291
}

0 commit comments

Comments
 (0)