1
0
mirror of https://github.com/Escartem/AnimeWwise.git synced 2026-06-04 23:40:25 +08:00

fix map decode error

This commit is contained in:
Escartem
2026-04-26 12:28:21 -04:00
parent 4640be1830
commit 4e8b363795
3 changed files with 11 additions and 14 deletions

View File

@@ -49,20 +49,17 @@ class Mapper:
# sectors
def int24():
val = int.from_bytes(reader.ReadBytes(3), "big")
if val == 0:
int.from_bytes(reader.ReadBytes(4), "big")
return val
val = reader.ReadBytes(3)
if val == b"\xFF" * 3:
val = reader.ReadBytes(4)
return int.from_bytes(val, "big")
sectors = {
# offset | size
"languages": [int24(), int24()],
"strings": [int24(), int24()],
"words": [int24(), int24()],
"files": [int24(), int24()],
"keys": [int24(), int24()],
"music": [int24(), int24()]
}
names = ["languages", "strings", "words", "files", "keys", "music"]
sectors = {n: [int24(), int24()] for n in names}
if list(sectors.values())[0][0] == 0:
offset = reader.GetBufferPos()
for v in sectors.values():
v[0] += offset
# languages
reader.SetBufferPos(sectors["languages"][0])

Binary file not shown.

View File

@@ -1,6 +1,6 @@
{
"version": 223,
"mapsVersion": 133,
"mapsVersion": 134,
"maps": [
{
"name": "hk4e.map",