]> git.lizzy.rs Git - nothing.git/commitdiff
Make the level_editor_from_file support VERSION 1
authorrexim <reximkut@gmail.com>
Sun, 15 Dec 2019 17:04:03 +0000 (00:04 +0700)
committerrexim <reximkut@gmail.com>
Sun, 15 Dec 2019 17:04:03 +0000 (00:04 +0700)
src/game/level/level_editor.c

index eabb9ffa827e1f50bbb62764c0582bdb0765c4df..11af440e5e463a541e20980e8c13c23282f21593 100644 (file)
@@ -195,7 +195,12 @@ LevelEditor *create_level_editor_from_file(const char *file_name, Cursor *cursor
                METADATA_VERSION_MAX_SIZE - 1));
     trim_endline(version);
 
-    if (strcmp(version, VERSION) != 0) {
+    if (strcmp(version, "1") == 0) {
+        if (line_stream_next(level_stream) == NULL)
+            RETURN_LT(lt, NULL);
+    } else if (strcmp(version, "2") == 0) {
+        // Nothing
+    } else {
         log_fail("Version `%s` is not supported. Expected version `%s`.\n",
                  version, VERSION);
         RETURN_LT(lt, NULL);