Skip to content

Commit

Permalink
Bugfix
Browse files Browse the repository at this point in the history
Fixed bugs with 2 version.
  • Loading branch information
TesterTesterov authored May 31, 2023
1 parent 8daed13 commit 1113418
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 11 deletions.
15 changes: 5 additions & 10 deletions ai5win_mes.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class AI5WINScript(SilkyMesScript):
(b'\xeb\xaf', b'*f'),
)

header_version_threshold = 3
header_version_threshold = 2
supported_versions = (
#-1, "Isaku, etc. ~ 1997 y."),
# Too much troubles without any need.
Expand Down Expand Up @@ -221,20 +221,15 @@ class AI5WINScript(SilkyMesScript):
(0x09, 1),
(0x0a, 0),
(0x0e, 2),
),
1: (
(0x09, 1),
(0x0a, 0),
(0x0e, 2),
(0x12, 1),
),
2: (
1: (
(0x0b, 1),
(0x0c, 0),
(0x10, 1),
(0x14, 1),
),
3: (
2: (
(0x0b, 1),
(0x0c, 0),
(0x10, 1),
Expand Down Expand Up @@ -290,7 +285,7 @@ def assemble(self) -> None:

if self._verbose:
print("Parameters:", self._prm[0:1])
if self.version > self.header_version_threshold:
if self.version >= self.header_version_threshold:
print("First offsets:", len(self._first_offsets), self._first_offsets)
print("True offsets:", len(self._offsets), self._offsets)
self._assemble_script_file()
Expand All @@ -309,7 +304,7 @@ def _assemble_script_file(self) -> None:
message_count = 0
search_offset = [i[0] for i in self._offsets]

if self.version > self.header_version_threshold:
if self.version >= self.header_version_threshold:
out_file.write(struct.pack('I', self._prm[0]))
for first_offset in self._first_offsets:
out_file.write(struct.pack('I', first_offset))
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

cx_Freeze.setup(
name="AI5WINScriptTool",
version="1.0",
version="1.1",
description="Dual languaged (rus+eng) tool for compiling and decompiling mes scripts of AI5WIN.\n"
"Двухязычное средство (рус+англ) для компиляции и декомпиляции скриптов mes AI5WIN.",
options={"build_exe": {"packages": []}},
Expand Down

0 comments on commit 1113418

Please sign in to comment.