Skip to content

Commit

Permalink
update faulty script
Browse files Browse the repository at this point in the history
  • Loading branch information
cesaregarza committed Oct 27, 2024
1 parent cbc9ec9 commit 149916e
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions scripts/update_assets.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,9 @@ def process_rowid(row_id: str) -> dict[str, str]:
return {
"class": weapon_class,
"kit": f"{weapon_main}_{weapon_suffix}",
"reference_kit": f"{weapon_main}_{weapon_reference_suffix}",
"reference_kit": (
f"{weapon_class}_{weapon_main}_{weapon_reference_suffix}"
),
}


Expand All @@ -160,9 +162,18 @@ def process_weapon_data(preprocessed_data: dict[int, dict]) -> dict[int, dict]:
**process_rowid(row_id),
}
# Find the reverse mapping for each weapon and add it
reverse_map = {v["reference_kit"]: k for k, v in out.items()}
reverse_map = {
v["reference_kit"]: k
for k, v in out.items()
if (v["reference_kit"] == (v["class"] + "_" + v["kit"]))
}
for _, weapon_data in out.items():
weapon_data["reference_id"] = reverse_map[weapon_data["reference_kit"]]

for _, weapon_data in out.items():
weapon_data["reference_kit"] = "_".join(
weapon_data["reference_kit"].split("_")[1:]
)
return out


Expand Down

0 comments on commit 149916e

Please sign in to comment.