From 030c498f9beece698c51cb6497640e29a31f7647 Mon Sep 17 00:00:00 2001 From: Dale Floer Date: Thu, 4 Jun 2020 14:49:48 -0700 Subject: [PATCH] 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. --- lihzahrd/header/version.py | 1 + lihzahrd/world.py | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lihzahrd/header/version.py b/lihzahrd/header/version.py index a893675..bbd3037 100644 --- a/lihzahrd/header/version.py +++ b/lihzahrd/header/version.py @@ -51,6 +51,7 @@ class Version: 226: "1.4.0.2", 227: "1.4.0.3", 228: "1.4.0.4", + 230: "1.4.0.5", } def __init__(self, data: typing.Union[int, str]): diff --git a/lihzahrd/world.py b/lihzahrd/world.py index 114a3cd..ad5e491 100644 --- a/lihzahrd/world.py +++ b/lihzahrd/world.py @@ -116,7 +116,7 @@ class World: seed.""" self.is_for_the_worthy: bool = is_for_the_worthy - """Was this world created with the + """Was this world created with the `for the worthy ` seed.""" self.created_on = created_on @@ -371,7 +371,8 @@ class World: version = Version(f.int4()) relogic = f.string(7) 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.") revision = f.uint4()