1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2024-11-29 03:34:07 +00:00

Fix colliderinit.py to run from project root (#531)

* Now works from root but not from overlayhelpers

* Fix to run from anywhere
This commit is contained in:
Tharo 2020-12-15 23:27:35 +00:00 committed by GitHub
parent 92e9f2d370
commit 5632df406b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 4 deletions

View file

@ -2,8 +2,7 @@
from overlayhelpers import filemap from overlayhelpers import filemap
import argparse import argparse, os, struct
import struct
""" """
Enumerations Enumerations
@ -472,8 +471,9 @@ def main():
print(file_result) print(file_result)
print() print()
script_dir = os.path.dirname(os.path.realpath(__file__))
cs_data = None cs_data = None
with open("baserom/" + file_result.name, "rb") as ovl_file: with open(script_dir + "/../baserom/" + file_result.name, "rb") as ovl_file:
ovl_file.seek(file_result.offset) ovl_file.seek(file_result.offset)
cs_data = [i[0] for i in struct.iter_unpack(">I", bytearray(ovl_file.read()))] cs_data = [i[0] for i in struct.iter_unpack(">I", bytearray(ovl_file.read()))]
if cs_data is not None: if cs_data is not None:

View file

@ -1,5 +1,6 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
import os
import struct import struct
import argparse import argparse
from filemap import FileResult, GetFromVRam, GetFromRom from filemap import FileResult, GetFromVRam, GetFromRom
@ -223,7 +224,9 @@ else:
print("ItemInit type must specify number of elements") print("ItemInit type must specify number of elements")
exit() exit()
ovlFile = open("../../baserom/" + fileResult.name, "rb") script_dir = os.path.dirname(os.path.realpath(__file__))
ovlFile = open(script_dir + "/../../baserom/" + fileResult.name, "rb")
ovlData = bytearray(ovlFile.read()) ovlData = bytearray(ovlFile.read())
ovlFile.close() ovlFile.close()