1
Fork 0
mirror of https://github.com/Steffo99/lihzahrd.git synced 2024-11-25 01:24:21 +00:00

Bump version support to include 1.4.0.5

1.4.0.5 does not appear to have made any worldfile format changes over
  1.4.0.4, so this code should work for both.
This commit is contained in:
Dale Floer 2020-06-04 14:49:48 -07:00
parent ef30c924e9
commit 030c498f9b
2 changed files with 4 additions and 2 deletions

View file

@ -51,6 +51,7 @@ class Version:
226: "1.4.0.2", 226: "1.4.0.2",
227: "1.4.0.3", 227: "1.4.0.3",
228: "1.4.0.4", 228: "1.4.0.4",
230: "1.4.0.5",
} }
def __init__(self, data: typing.Union[int, str]): def __init__(self, data: typing.Union[int, str]):

View file

@ -371,7 +371,8 @@ class World:
version = Version(f.int4()) version = Version(f.int4())
relogic = f.string(7) relogic = f.string(7)
savefile_type = f.uint1() savefile_type = f.uint1()
if version != Version("1.4.0.4") or relogic != "relogic" or savefile_type != 2: supported_versions = (Version("1.4.0.4"), Version("1.4.0.5"))
if version not in supported_versions or relogic != "relogic" or savefile_type != 2:
raise NotImplementedError("This parser can only read Terraria 1.4.0.4 save files.") raise NotImplementedError("This parser can only read Terraria 1.4.0.4 save files.")
revision = f.uint4() revision = f.uint4()