Skip to content

Commit

Permalink
feat: support addresslib matching for fo4
Browse files Browse the repository at this point in the history
  • Loading branch information
alandtse committed Mar 21, 2023
1 parent aa482f2 commit 94ef642
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 20 deletions.
2 changes: 1 addition & 1 deletion fallout_vr_address_library
Submodule fallout_vr_address_library updated 1 files
+1,582,976 −0 addrlib.csv
41 changes: 22 additions & 19 deletions vr_address_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,25 +200,28 @@ async def load_database(
except FileNotFoundError:
print(f"database.csv not found")

if skyrim:
try:
async with aiofiles.open(os.path.join(path, addresslib), mode="r") as infile:
reader = aiocsv.AsyncDictReader(infile)
async for row in reader:
id = int(row["id"])
sse = add_hex_strings(row["sse"])
vr = add_hex_strings(row["vr"])
if id_vr_status.get(id):
if debug:
print(
f"Database Load Warning: {id} already loaded skipping load from {addresslib}"
)
else:
id_sse[id] = sse
id_vr[id] = vr
loaded += 1
except FileNotFoundError:
print(f"{addresslib} not found")
try:
async with aiofiles.open(os.path.join(path, addresslib), mode="r") as infile:
reader = aiocsv.AsyncDictReader(infile)
async for row in reader:
id = int(row["id"])
sse = add_hex_strings(row.get("sse" if skyrim else "fo4_addr"))
vr = add_hex_strings(row.get("vr" if skyrim else "vr_addr"))
if id_vr_status.get(id):
if debug:
print(
f"Database Load Warning: {id} already loaded skipping load from {addresslib}"
)
elif vr:
id_sse[id] = sse
id_vr[id] = vr
id_vr_status[id] = {
"sse": sse,
"status": CONFIDENCE["SUGGESTED"],
}
loaded += 1
except FileNotFoundError:
print(f"{addresslib} not found")

try:
async with aiofiles.open(os.path.join(path, offsets), mode="r") as infile:
Expand Down

0 comments on commit 94ef642

Please sign in to comment.