Skip to content

Commit

Permalink
Merge pull request #74727 from anothersimulacrum/fix-gun-variant-check
Browse files Browse the repository at this point in the history
Fix bug in gun variant validator script
  • Loading branch information
Maleclypse authored Jun 23, 2024
2 parents 7c65121 + 0c5459f commit f9888e2
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions tools/json_tools/gun_variant_validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -309,11 +309,10 @@ def simplify_object(jo):
return False

req_keys = {"weight", "volume", "ammo", "id"}
extra_keys = {"longest_side", "pocket_data", "ranged_damage", "modes",
"recoil", "dispersion", "name"}
all_keys = req_keys | set(INHERITED_KEYS)

# Drop all the other keys
removed = list(filter(lambda key: key not in req_keys | extra_keys,
jo.keys()))
removed = list(filter(lambda key: key not in all_keys, jo.keys()))
# Need to iterate over removed because we can't delete from dict in for
for key in removed:
del jo[key]
Expand Down

0 comments on commit f9888e2

Please sign in to comment.